Package overit.geocall.da
Interface QueryHelper
- All Known Implementing Classes:
QueryHelperImpl
public interface QueryHelper
Helper class that provides useful methods when creating a
SQL query.-
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.
-
Method Details
-
makeWhereClause
String makeWhereClause(@NotNull @NotNull DABase daBase, @NotNull @NotNull String prefix, Map<String, Object> filters) - 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
String makeWhereClause(String[] fields, @NotNull @NotNull String prefix, Map<String, Object> filters) - 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
String makeWhereClauseWithPrimaryKeysOnly(@NotNull @NotNull DABase daBase, Map<String, Object> filters) -
makeOrderClause
-
makeColumnList
Returns aStringabout the comma separated column list associated to eachvalueskey.
Each returned column will be prefixed with@. -
makeQuestionList
Returns aStringabout the comma separated column list associated to eachvalueskey.
Each returned column will be prefixed with?. -
makeColumnList
Returns aStringabout the comma separated column list using the providedcolumns.
Each returned column will be prefixed with@. -
makeUpdateList
String makeUpdateList(@NotNull @NotNull DABase daBase, @NotNull @NotNull Map<String, Object> values, @NotNull @NotNull Map<String, Object> filters) Returns aStringabout a list of fields that have to be updated when creating anUPDATE query, using the provided parameters.- 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.
-