Class CustomQuerySpecification<T>
java.lang.Object
com.blazebit.persistence.impl.query.CustomQuerySpecification<T>
- All Implemented Interfaces:
QuerySpecification<T>
- Direct Known Subclasses:
CTEQuerySpecification,ModificationQuerySpecification,SetOperationQuerySpecification
public class CustomQuerySpecification<T> extends Object implements QuerySpecification<T>
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>addedCtesprotected javax.persistence.QuerybaseQueryprotected StringcountPrefixprotected javax.persistence.QuerycountWrapperExampleQueryprotected List<CTENode>ctesprotected DbmsDialectdbmsDialectprotected booleandirtyprotected javax.persistence.EntityManageremprotected List<EntityFunctionNode>entityFunctionNodesprotected ExtendedQuerySupportextendedQuerySupportprotected List<String>keyRestrictedLeftJoinAliasesprotected Stringlimitprotected Map<String,Collection<?>>listParametersprotected Stringoffsetprotected Set<javax.persistence.Parameter<?>>parametersprotected List<javax.persistence.Query>participatingQueriesprotected booleanqueryPlanCacheEnabledprotected booleanrecursiveprotected ServiceProviderserviceProviderprotected booleanshouldRenderCtesprotected Stringsqlprotected DbmsStatementTypestatementType -
Constructor Summary
Constructors Constructor Description CustomQuerySpecification(AbstractCommonQueryBuilder<?,?,?,?,?> commonQueryBuilder, javax.persistence.Query baseQuery, Set<javax.persistence.Parameter<?>> parameters, Set<String> listParameters, String limit, String offset, List<String> keyRestrictedLeftJoinAliases, List<EntityFunctionNode> entityFunctionNodes, boolean recursive, List<CTENode> ctes, boolean shouldRenderCtes, boolean queryPlanCacheEnabled, javax.persistence.Query countWrapperExampleQuery) -
Method Summary
Modifier and Type Method Description protected StringBuilderapplyCtes(StringBuilder sqlSb, javax.persistence.Query baseQuery, List<javax.persistence.Query> participatingQueries)protected Map<String,String>applyExtendedSql(StringBuilder sqlSb, boolean isSubquery, boolean isEmbedded, StringBuilder withClause, String dmlAffectedTable, String[] returningColumns, Map<DbmsModificationState,String> includedModificationStates)protected StringBuilderapplySqlTransformations(String sqlQuery)ModificationQueryPlancreateModificationPlan(int firstResult, int maxResults)SelectQueryPlan<T>createSelectPlan(int firstResult, int maxResults)Map<String,String>getAddedCtes()javax.persistence.QuerygetBaseQuery()Set<javax.persistence.Parameter<?>>getParameters()List<javax.persistence.Query>getParticipatingQueries()StringgetSql()protected voidinitialize()voidonCollectionParameterChange(String parameterName, Collection<?> value)
-
Field Details
-
em
protected final javax.persistence.EntityManager em -
dbmsDialect
-
serviceProvider
-
extendedQuerySupport
-
statementType
-
baseQuery
protected final javax.persistence.Query baseQuery -
parameters
-
listParameters
-
limit
-
offset
-
keyRestrictedLeftJoinAliases
-
entityFunctionNodes
-
recursive
protected final boolean recursive -
ctes
-
shouldRenderCtes
protected final boolean shouldRenderCtes -
queryPlanCacheEnabled
protected final boolean queryPlanCacheEnabled -
countWrapperExampleQuery
protected final javax.persistence.Query countWrapperExampleQuery -
countPrefix
-
dirty
protected boolean dirty -
sql
-
participatingQueries
-
addedCtes
-
-
Constructor Details
-
CustomQuerySpecification
public CustomQuerySpecification(AbstractCommonQueryBuilder<?,?,?,?,?> commonQueryBuilder, javax.persistence.Query baseQuery, Set<javax.persistence.Parameter<?>> parameters, Set<String> listParameters, String limit, String offset, List<String> keyRestrictedLeftJoinAliases, List<EntityFunctionNode> entityFunctionNodes, boolean recursive, List<CTENode> ctes, boolean shouldRenderCtes, boolean queryPlanCacheEnabled, javax.persistence.Query countWrapperExampleQuery)
-
-
Method Details
-
createModificationPlan
- Specified by:
createModificationPlanin interfaceQuerySpecification<T>
-
createSelectPlan
- Specified by:
createSelectPlanin interfaceQuerySpecification<T>
-
getSql
- Specified by:
getSqlin interfaceQuerySpecification<T>
-
getParticipatingQueries
- Specified by:
getParticipatingQueriesin interfaceQuerySpecification<T>
-
getParameters
- Specified by:
getParametersin interfaceQuerySpecification<T>
-
getAddedCtes
- Specified by:
getAddedCtesin interfaceQuerySpecification<T>
-
getBaseQuery
public javax.persistence.Query getBaseQuery()- Specified by:
getBaseQueryin interfaceQuerySpecification<T>
-
onCollectionParameterChange
- Specified by:
onCollectionParameterChangein interfaceQuerySpecification<T>
-
initialize
protected void initialize() -
applyExtendedSql
protected Map<String,String> applyExtendedSql(StringBuilder sqlSb, boolean isSubquery, boolean isEmbedded, StringBuilder withClause, String dmlAffectedTable, String[] returningColumns, Map<DbmsModificationState,String> includedModificationStates) -
applyCtes
protected StringBuilder applyCtes(StringBuilder sqlSb, javax.persistence.Query baseQuery, List<javax.persistence.Query> participatingQueries) -
applySqlTransformations
-