Class QueryHelperImpl

java.lang.Object
overit.geocall.da.QueryHelperImpl
All Implemented Interfaces:
QueryHelper

@Service public class QueryHelperImpl extends Object implements QueryHelper
QueryHelper standard implementation.
  • Constructor Details

  • Method Details

    • makeWhereClause

      public String makeWhereClause(@NotNull @NotNull DABase daBase, @NotNull @NotNull String prefix, Map<String,Object> filters)
      Description copied from interface: QueryHelper
      Returns a String about the WHERE portion of an SQL query using the provided parameters.
      Specified by:
      makeWhereClause in interface QueryHelper
      Parameters:
      daBase - DABase associated with the SQL query that needs to be created.
      prefix - String about the prefix to use before the value placeholder.
      filters - Map<String, Object> about the filters to apply to the generated SQL query.
      Returns:
      a String about the WHERE portion of an SQL query using the provided parameters.
    • makeWhereClause

      public String makeWhereClause(String[] fields, @NotNull @NotNull String prefix, Map<String,Object> filters)
      Description copied from interface: QueryHelper
      Returns a String about the WHERE portion of an SQL query using the provided parameters.
      Specified by:
      makeWhereClause in interface QueryHelper
      Parameters:
      fields - String[] relating to the fields on which it is necessary to set a filter criterion.
      prefix - String about the prefix to use before the value placeholder.
      filters - Map<String, Object> about the filters to apply to the generated SQL query.
      Returns:
      a String about the WHERE portion of an SQL query using the provided parameters.
    • makeWhereClauseWithPrimaryKeysOnly

      public String makeWhereClauseWithPrimaryKeysOnly(@NotNull @NotNull DABase daBase, @NotNull @NotNull Map<String,Object> filters)
      Description copied from interface: QueryHelper
      Returns a String about the WHERE portion of an SQL query using only filters defined on primary key fields of the provided DABase.
      Specified by:
      makeWhereClauseWithPrimaryKeysOnly in interface QueryHelper
      Parameters:
      daBase - DABase associated with the SQL query that needs to be created.
      filters - Map<String, Object> about the filters to apply to the generated SQL query.
      Returns:
      a String about the WHERE portion of an SQL query using only filters defined on primary key fields of the provided DABase.
    • makeOrderClause

      public String makeOrderClause(@NotNull @NotNull DABase daBase)
      Description copied from interface: QueryHelper
      Returns a String about the ORDER BY portion of an SQL query associated to the provided DABase.
      Specified by:
      makeOrderClause in interface QueryHelper
      Parameters:
      daBase - DABase associated with the SQL query that needs to be created.
      Returns:
      a String about the ORDER BY portion of an SQL query associated to the provided DABase.
    • makeColumnList

      public String makeColumnList(Map<String,Object> values)
      Description copied from interface: QueryHelper
      Returns a String about the comma separated column list associated to each values key.
      Each returned column will be prefixed with @.
      Specified by:
      makeColumnList in interface QueryHelper
      Parameters:
      values - Map<String, Object> about the values to consider when creating an SQL query.
      Returns:
      a String about the comma separated column list associated to each values key.
      Each returned column will be prefixed with @.
    • makeQuestionList

      public String makeQuestionList(Map<String,Object> values)
      Description copied from interface: QueryHelper
      Returns a String about the comma separated column list associated to each values key.
      Each returned column will be prefixed with ?.
      Specified by:
      makeQuestionList in interface QueryHelper
      Parameters:
      values - Map<String, Object> about the values to consider when creating an SQL query.
      Returns:
      a String about the comma separated column list associated to each values key
      Each returned column will be prefixed with ?.
    • makeColumnList

      public String makeColumnList(String[] columns)
      Description copied from interface: QueryHelper
      Returns a String about the comma separated column list using the provided columns.
      Each returned column will be prefixed with @.
      Specified by:
      makeColumnList in interface QueryHelper
      Parameters:
      columns - String[] about the columns to consider when creating an SQL query.
      Returns:
      a String about the comma separated column list using the provided columns.
      Each returned column will be prefixed with @.
    • makeUpdateList

      public String makeUpdateList(@NotNull @NotNull DABase daBase, @NotNull @NotNull Map<String,Object> values, @NotNull @NotNull Map<String,Object> filters)
      Description copied from interface: QueryHelper
      Returns a String about a list of fields that have to be updated when creating an UPDATE query, using the provided parameters.
      Specified by:
      makeUpdateList in interface QueryHelper
      Parameters:
      daBase - DABase associated with the SQL query that needs to be created.
      values - Map<String, Object> about the values to consider when creating an SQL query.
      filters - Map<String, Object> about the filters to apply to the generated SQL query.
      Returns:
      a String about a list of fields that have to be updated when creating an UPDATE query, using the provided parameters.