Class CustomQuerySpecification<T>
- java.lang.Object
-
- com.blazebit.persistence.impl.query.CustomQuerySpecification<T>
-
- All Implemented Interfaces:
QuerySpecification<T>
- Direct Known Subclasses:
CTEQuerySpecification,ModificationQuerySpecification,ReturningModificationQuerySpecification,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 List<CTENode>ctesprotected com.blazebit.persistence.spi.DbmsDialectdbmsDialectprotected booleandirtyprotected javax.persistence.EntityManageremprotected List<EntityFunctionNode>entityFunctionNodesprotected com.blazebit.persistence.spi.ExtendedQuerySupportextendedQuerySupportprotected List<String>keyRestrictedLeftJoinAliasesprotected Stringlimitprotected Map<String,Collection<?>>listParametersprotected Stringoffsetprotected Set<javax.persistence.Parameter<?>>parametersprotected List<javax.persistence.Query>participatingQueriesprotected booleanrecursiveprotected com.blazebit.persistence.spi.ServiceProviderserviceProviderprotected booleanshouldRenderCtesprotected Stringsqlprotected com.blazebit.persistence.spi.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)
-
Method Summary
All Methods Instance Methods Concrete Methods 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[] returningColumns, Map<com.blazebit.persistence.spi.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 Detail
-
em
protected final javax.persistence.EntityManager em
-
dbmsDialect
protected final com.blazebit.persistence.spi.DbmsDialect dbmsDialect
-
serviceProvider
protected final com.blazebit.persistence.spi.ServiceProvider serviceProvider
-
extendedQuerySupport
protected final com.blazebit.persistence.spi.ExtendedQuerySupport extendedQuerySupport
-
statementType
protected final com.blazebit.persistence.spi.DbmsStatementType statementType
-
baseQuery
protected final javax.persistence.Query baseQuery
-
parameters
protected final Set<javax.persistence.Parameter<?>> parameters
-
listParameters
protected final Map<String,Collection<?>> listParameters
-
limit
protected final String limit
-
offset
protected final String offset
-
entityFunctionNodes
protected final List<EntityFunctionNode> entityFunctionNodes
-
recursive
protected final boolean recursive
-
shouldRenderCtes
protected final boolean shouldRenderCtes
-
dirty
protected boolean dirty
-
sql
protected String sql
-
participatingQueries
protected List<javax.persistence.Query> participatingQueries
-
-
Constructor Detail
-
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)
-
-
Method Detail
-
createModificationPlan
public ModificationQueryPlan createModificationPlan(int firstResult, int maxResults)
- Specified by:
createModificationPlanin interfaceQuerySpecification<T>
-
createSelectPlan
public SelectQueryPlan<T> createSelectPlan(int firstResult, int maxResults)
- Specified by:
createSelectPlanin interfaceQuerySpecification<T>
-
getSql
public String getSql()
- Specified by:
getSqlin interfaceQuerySpecification<T>
-
getParticipatingQueries
public List<javax.persistence.Query> getParticipatingQueries()
- Specified by:
getParticipatingQueriesin interfaceQuerySpecification<T>
-
getParameters
public Set<javax.persistence.Parameter<?>> getParameters()
- Specified by:
getParametersin interfaceQuerySpecification<T>
-
getAddedCtes
public Map<String,String> getAddedCtes()
- Specified by:
getAddedCtesin interfaceQuerySpecification<T>
-
getBaseQuery
public javax.persistence.Query getBaseQuery()
- Specified by:
getBaseQueryin interfaceQuerySpecification<T>
-
onCollectionParameterChange
public void onCollectionParameterChange(String parameterName, Collection<?> value)
- Specified by:
onCollectionParameterChangein interfaceQuerySpecification<T>
-
initialize
protected void initialize()
-
applyExtendedSql
protected Map<String,String> applyExtendedSql(StringBuilder sqlSb, boolean isSubquery, boolean isEmbedded, StringBuilder withClause, String[] returningColumns, Map<com.blazebit.persistence.spi.DbmsModificationState,String> includedModificationStates)
-
applyCtes
protected StringBuilder applyCtes(StringBuilder sqlSb, javax.persistence.Query baseQuery, List<javax.persistence.Query> participatingQueries)
-
applySqlTransformations
protected StringBuilder applySqlTransformations(String sqlQuery)
-
-