Class AbstractQueryBuilder
java.lang.Object
com.almis.awe.config.ServiceConfig
com.almis.awe.service.data.builder.AbstractQueryBuilder
- All Implemented Interfaces:
QueryBuilder
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
QueueBuilder
,ServiceBuilder
,SQLBuilder
Abstract query builder
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<SortColumn>
protected com.fasterxml.jackson.databind.node.ObjectNode
protected final QueryUtil
protected Integer
protected Map<String,
QueryParameter> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addComponentSort
(com.fasterxml.jackson.databind.node.ArrayNode sortList) Generate the sortlist from component sortextractValuesFromParameters
(Map<String, QueryParameter> variables) Extracts all values inside QueryParameters to use as arguments while calling the serviceprotected String
getVariableAsString
(com.fasterxml.jackson.databind.JsonNode varValue) Generic variable value callRetrieve query generated variablessetVariables
(Map<String, QueryParameter> parameterMap) Set variablesprotected Object
Get parameter from JSONMethods inherited from class com.almis.awe.config.ServiceConfig
containsBean, getApplicationContext, getBean, getBean, getElements, getLocale, getLocale, getProperty, getProperty, getRequest, getSession, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.almis.awe.service.data.builder.QueryBuilder
build, setQuery
-
Field Details
-
queryUtil
-
parameters
protected com.fasterxml.jackson.databind.node.ObjectNode parameters -
variables
-
variableIndex
-
componentSortList
-
-
Constructor Details
-
AbstractQueryBuilder
Autowired constructor- Parameters:
queryUtil
- Query utilities
-
-
Method Details
-
getVariables
Retrieve query generated variables- Specified by:
getVariables
in interfaceQueryBuilder
- Returns:
- Query parameters
- Throws:
AWException
- Error retrieving query parameters
-
setVariables
Set variables- Specified by:
setVariables
in interfaceQueryBuilder
- Parameters:
parameterMap
- Parameter map- Returns:
- this
-
addComponentSort
protected void addComponentSort(com.fasterxml.jackson.databind.node.ArrayNode sortList) Generate the sortlist from component sort- Parameters:
sortList
- Component sort
-
getVariableAsString
Generic variable value call- Parameters:
varValue
- Variable- Returns:
- Variable as string
-
extractValuesFromParameters
Extracts all values inside QueryParameters to use as arguments while calling the service- Parameters:
variables
- query's variable map- Returns:
- map with values extracted
-
transformFromJsonNode
Get parameter from JSON- Parameters:
param
- Parameter- Returns:
- Object
-