Package overit.geocall.da
Class QueryHelperImpl
java.lang.Object
overit.geocall.da.QueryHelperImpl
- All Implemented Interfaces:
QueryHelper
QueryHelper standard implementation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmakeColumnList(String[] columns) Returns aStringabout the comma separated column list using the providedcolumns.
Each returned column will be prefixed with@.makeColumnList(Map<String, Object> values) Returns aStringabout the comma separated column list associated to eachvalueskey.
Each returned column will be prefixed with@.makeOrderClause(@NotNull DABase daBase) makeQuestionList(Map<String, Object> values) Returns aStringabout the comma separated column list associated to eachvalueskey.
Each returned column will be prefixed with?.makeUpdateList(@NotNull DABase daBase, @NotNull Map<String, Object> values, @NotNull Map<String, Object> filters) Returns aStringabout a list of fields that have to be updated when creating anUPDATE query, using the provided parameters.
-
Constructor Details
-
QueryHelperImpl
-
-
Method Details
-
makeWhereClause
public String makeWhereClause(@NotNull @NotNull DABase daBase, @NotNull @NotNull String prefix, Map<String, Object> filters) Description copied from interface:QueryHelper- Specified by:
makeWhereClausein interfaceQueryHelper- Parameters:
daBase-DABaseassociated with theSQL querythat needs to be created.prefix-Stringabout the prefix to use before the value placeholder.filters-Map<String,Object> about the filters to apply to the generatedSQL query.- Returns:
- a
Stringabout theWHEREportion of anSQL queryusing the provided parameters.
-
makeWhereClause
public String makeWhereClause(String[] fields, @NotNull @NotNull String prefix, Map<String, Object> filters) Description copied from interface:QueryHelper- Specified by:
makeWhereClausein interfaceQueryHelper- Parameters:
fields-String[] relating to the fields on which it is necessary to set a filter criterion.prefix-Stringabout the prefix to use before the value placeholder.filters-Map<String,Object> about the filters to apply to the generatedSQL query.- Returns:
- a
Stringabout theWHEREportion of anSQL queryusing the provided parameters.
-
makeWhereClauseWithPrimaryKeysOnly
public String makeWhereClauseWithPrimaryKeysOnly(@NotNull @NotNull DABase daBase, @NotNull @NotNull Map<String, Object> filters) Description copied from interface:QueryHelperReturns aStringabout theWHEREportion of anSQL queryusing only filters defined on primary key fields of the providedDABase.- Specified by:
makeWhereClauseWithPrimaryKeysOnlyin interfaceQueryHelper- Parameters:
daBase-DABaseassociated with theSQL querythat needs to be created.filters-Map<String,Object> about the filters to apply to the generatedSQL query.- Returns:
- a
Stringabout theWHEREportion of anSQL queryusing only filters defined on primary key fields of the providedDABase.
-
makeOrderClause
Description copied from interface:QueryHelper- Specified by:
makeOrderClausein interfaceQueryHelper- Parameters:
daBase-DABaseassociated with theSQL querythat needs to be created.- Returns:
- a
Stringabout theORDER BYportion of anSQL queryassociated to the providedDABase.
-
makeColumnList
Description copied from interface:QueryHelperReturns aStringabout the comma separated column list associated to eachvalueskey.
Each returned column will be prefixed with@.- Specified by:
makeColumnListin interfaceQueryHelper- Parameters:
values-Map<String,Object> about the values to consider when creating anSQL query.- Returns:
- a
Stringabout the comma separated column list associated to eachvalueskey.
Each returned column will be prefixed with@.
-
makeQuestionList
Description copied from interface:QueryHelperReturns aStringabout the comma separated column list associated to eachvalueskey.
Each returned column will be prefixed with?.- Specified by:
makeQuestionListin interfaceQueryHelper- Parameters:
values-Map<String,Object> about the values to consider when creating anSQL query.- Returns:
- a
Stringabout the comma separated column list associated to eachvalueskey
Each returned column will be prefixed with?.
-
makeColumnList
Description copied from interface:QueryHelperReturns aStringabout the comma separated column list using the providedcolumns.
Each returned column will be prefixed with@.- Specified by:
makeColumnListin interfaceQueryHelper- Parameters:
columns-String[] about the columns to consider when creating anSQL query.- Returns:
- a
Stringabout the comma separated column list using the providedcolumns.
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:QueryHelperReturns aStringabout a list of fields that have to be updated when creating anUPDATE query, using the provided parameters.- Specified by:
makeUpdateListin interfaceQueryHelper- Parameters:
daBase-DABaseassociated with theSQL querythat needs to be created.values-Map<String,Object> about the values to consider when creating anSQL query.filters-Map<String,Object> about the filters to apply to the generatedSQL query.- Returns:
- a
Stringabout a list of fields that have to be updated when creating anUPDATE query, using the provided parameters.
-