Class PostgreSqlHelper

java.lang.Object
io.clonecloudstore.common.database.postgre.PostgreSqlHelper

public final class PostgreSqlHelper extends Object
Postgre Sql Helper
  • Field Details

  • Method Details

    • query

      public static String query(DbQuery query)
      Usable in Panache find, delete... as condition with getSqlParamsAsArray()
      Parameters:
      query - the DbQuery
      Returns:
      the native Query (Where part only) ready to use with extra parameters as "?"
    • select

      public static String select(String table, DbQuery query)
      For Native Query only with additional parameters using getSqlParamsAsArray()
      Parameters:
      table - the table name
      query - the DbQuery
      Returns:
      the SELECT native Query with extra parameters as "?"
    • count

      public static String count(String table, DbQuery query)
      For Native Query only with additional parameters using getSqlParamsAsArray()
      Parameters:
      table - the table name
      query - the DbQuery
      Returns:
      the COUNT native Query with extra parameters as "?"
    • delete

      public static String delete(String table, DbQuery query)
      For Native Query only with additional parameters using getSqlParamsAsArray()
      Parameters:
      table - the table name
      query - the DbQuery
      Returns:
      the DELETE native Query with extra parameters as "?"
    • update

      public static String update(DbUpdate update, DbQuery query)
      Usable in Panache update with getUpdateParamsAsArray()
      Parameters:
      update - the DbUpdate
      query - the DbQuery
      Returns:
      the native Query (Update and Where parts only) with extra parameters as "?"
    • getUpdateParamsAsArray

      public static Object[] getUpdateParamsAsArray(DbUpdate update, DbQuery query)
      Parameters:
      update - the DbUpdate
      query - the DbQuery
      Returns:
      the extra parameters to replace "?"