Class SQLQueryBuilder
java.lang.Object
com.almis.awe.config.ServiceConfig
com.almis.awe.service.data.builder.AbstractQueryBuilder
com.almis.awe.service.data.builder.SQLBuilder
com.almis.awe.service.data.builder.SQLQueryBuilder
- All Implemented Interfaces:
QueryBuilder
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
Generates sql codes
-
Field Summary
Fields inherited from class com.almis.awe.service.data.builder.AbstractQueryBuilder
componentSortList, parameters, queryUtil, variableIndex, variables
-
Constructor Summary
ConstructorDescriptionSQLQueryBuilder
(QueryUtil queryUtil, EncodeService encodeService) Autowired constructor -
Method Summary
Modifier and TypeMethodDescriptioncom.querydsl.sql.SQLQuery<com.querydsl.core.Tuple>
build()
Builds the SQLQueryprotected void
doWhere
(com.querydsl.sql.SQLQuery<com.querydsl.core.Tuple> finalQuery) Adds WHERE operations to the SQLQueryprotected com.querydsl.core.types.Expression[]
Forms the Expressions for the SELECT operationprotected com.querydsl.core.types.Expression[]
getFieldsAlias
(String table) Forms the Expressions for the SELECT operationprotected com.querydsl.core.types.Expression[]
Forms the Expressions for the FROM operationSet query for count onlysetComponentSort
(com.fasterxml.jackson.databind.node.ArrayNode sortList) Generate the sortlist from component sortsetFactory
(com.querydsl.sql.SQLQueryFactory factory) Sets the SQLQueryFactory used by QueryDSL to create the SQLQuerysetParameters
(com.fasterxml.jackson.databind.node.ObjectNode parameters) Set querysetVariables
(Map<String, QueryParameter> variableMap) Set variablesMethods inherited from class com.almis.awe.service.data.builder.SQLBuilder
buildPath, buildPath, buildPath, generateOperationExpression, getCaseExpression, getConstantExpression, getExpressionCast, getExpressionFunction, getFactory, getFieldAliasExpression, getFieldExpression, getFilterGroups, getOperandExpression, getOperationExpression, getOrderByExpression, getOverExpression, getSimpleFieldExpression, getSqlFieldExpression, getStringExpression, getSubquery, getTable, getTableExpression, getVariableAsExpression, getVariableAsExpressionOrEmpty, getVariableAsExpressionOrNull, getVariableExpression
Methods inherited from class com.almis.awe.service.data.builder.AbstractQueryBuilder
addComponentSort, extractValuesFromParameters, getVariableAsString, getVariables, transformFromJsonNode
Methods inherited from class com.almis.awe.config.ServiceConfig
containsBean, getApplicationContext, getBean, getBean, getElements, getLocale, getLocale, getProperty, getProperty, getRequest, getSession, setApplicationContext
-
Constructor Details
-
SQLQueryBuilder
Autowired constructor- Parameters:
queryUtil
- Query utilitiesencodeService
- Encode service
-
-
Method Details
-
setComponentSort
Generate the sortlist from component sort- Parameters:
sortList
- Component sort- Returns:
- this
-
setQuery
Description copied from interface:QueryBuilder
Set query- Parameters:
query
- Query- Returns:
- query builder
-
setFactory
Description copied from class:SQLBuilder
Sets the SQLQueryFactory used by QueryDSL to create the SQLQuery- Overrides:
setFactory
in classSQLBuilder
- Parameters:
factory
- Factory- Returns:
- this
-
setVariables
Description copied from class:AbstractQueryBuilder
Set variables- Specified by:
setVariables
in interfaceQueryBuilder
- Overrides:
setVariables
in classAbstractQueryBuilder
- Parameters:
variableMap
- Parameter map- Returns:
- this
-
setParameters
-
queryForCount
Set query for count only- Returns:
- this
-
build
Builds the SQLQuery- Returns:
- SQLQuery prepared for fetch
- Throws:
AWException
- Error building query
-
getFields
Forms the Expressions for the SELECT operation- Returns:
- Expression[] expressions
- Throws:
AWException
- Error retrieving fields
-
getFieldsAlias
Forms the Expressions for the SELECT operation- Parameters:
table
- Field table- Returns:
- Expression[] expressions
-
getTables
Forms the Expressions for the FROM operation- Returns:
- Expression[] expressions
- Throws:
AWException
- Error retrieving tables
-
doWhere
protected void doWhere(com.querydsl.sql.SQLQuery<com.querydsl.core.Tuple> finalQuery) throws AWException Adds WHERE operations to the SQLQuery- Parameters:
finalQuery
- SQLQuery created in build method- Throws:
AWException
- Where statement generation error
-