Package com.blazebit.persistence.impl
Class AbstractModificationCriteriaBuilder<T,X extends BaseModificationCriteriaBuilder<X>,Y>
java.lang.Object
com.blazebit.persistence.impl.AbstractCommonQueryBuilder<T,X,AbstractCommonQueryBuilder<?,?,?,?,?>,AbstractCommonQueryBuilder<?,?,?,?,?>,BaseFinalSetOperationBuilderImpl<T,?,?>>
com.blazebit.persistence.impl.AbstractModificationCriteriaBuilder<T,X,Y>
- Type Parameters:
T
- The entity type of this modification builder
- All Implemented Interfaces:
BaseModificationCriteriaBuilder<X>
,BaseWhereBuilder<X>
,FromBaseBuilder<X>
,FromBuilder<X>
,FromProvider
,CTEInfoBuilder
,SimpleReturningBuilder
,ConfigurationSource
,ServiceProvider
,WhereBuilder<X>
- Direct Known Subclasses:
BaseDeleteCriteriaBuilderImpl
,BaseInsertCriteriaBuilderImpl
,BaseUpdateCriteriaBuilderImpl
public abstract class AbstractModificationCriteriaBuilder<T,X extends BaseModificationCriteriaBuilder<X>,Y>
extends AbstractCommonQueryBuilder<T,X,AbstractCommonQueryBuilder<?,?,?,?,?>,AbstractCommonQueryBuilder<?,?,?,?,?>,BaseFinalSetOperationBuilderImpl<T,?,?>>
implements BaseModificationCriteriaBuilder<X>, CTEInfoBuilder, SimpleReturningBuilder
- Since:
- 1.1.0
- Author:
- Christian Beikov
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Map<String,
ExtendedAttribute<?, ?>> protected final com.blazebit.persistence.impl.CTEManager.CTEKey
protected final javax.persistence.metamodel.EntityType<?>
protected final String
protected final javax.persistence.metamodel.EntityType<T>
protected final boolean
protected final CTEBuilderListener
protected final Y
Fields inherited from class com.blazebit.persistence.impl.AbstractCommonQueryBuilder
aliasManager, cachedExternalQueryString, cachedGroupByIdentifierExpressions, cachedQueryString, cbf, em, embeddableSplittingVisitor, explicitVersionEntities, expressionFactory, finalSetOperationBuilder, firstResult, fromClassExplicitlySet, functionalDependencyAnalyzerVisitor, groupByManager, hasCollections, hasGroupBy, havingManager, ID_PARAM_NAME, isMainQuery, joinManager, keyRestrictedLeftJoins, keysetManager, mainQuery, maxResults, needsCheck, nodesToFetch, orderByManager, parameterManager, queryContext, queryGenerator, resultType, selectManager, setOperationEnded, statementType, subqueryInitFactory, transformerGroups, whereManager, windowManager
-
Constructor Summary
ConstructorDescriptionAbstractModificationCriteriaBuilder
(AbstractModificationCriteriaBuilder<T, X, Y> builder, MainQuery mainQuery, QueryContext queryContext, Map<JoinManager, JoinManager> joinManagerMapping, ExpressionCopyContext copyContext) AbstractModificationCriteriaBuilder
(MainQuery mainQuery, QueryContext queryContext, boolean isMainQuery, DbmsStatementType statementType, Class<T> clazz, String alias, com.blazebit.persistence.impl.CTEManager.CTEKey cteKey, Class<?> cteClass, Y result, CTEBuilderListener listener) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyJpaReturning
(StringBuilder sbSelectFrom) com.blazebit.persistence.impl.CTEInfo
end()
int
<Z> ReturningResult<Z>
executeWithReturning
(ReturningObjectBuilder<Z> objectBuilder) ReturningResult<javax.persistence.Tuple>
executeWithReturning
(String... attributes) <Z> ReturningResult<Z>
executeWithReturning
(String attribute, Class<Z> type) protected javax.persistence.Query
protected <R> javax.persistence.TypedQuery<ReturningResult<R>>
getExecuteWithReturningQuery
(javax.persistence.TypedQuery<Object[]> exampleQuery, javax.persistence.Query baseQuery, String[] returningColumns, ReturningObjectBuilder<R> objectBuilder) protected String[]
getIdColumns
(ExtendedManagedType<?> extendedManagedType) getModificationStateRelatedTableNameRemappings
(Map<Class<?>, Map<String, DbmsModificationState>> explicitVersionEntities) protected Map<DbmsModificationState,
String> getModificationStates
(Map<Class<?>, Map<String, DbmsModificationState>> explicitVersionEntities) javax.persistence.Query
getQuery()
protected javax.persistence.Query
getQuery
(Map<DbmsModificationState, String> includedModificationStates) protected String[]
<Z> javax.persistence.TypedQuery<ReturningResult<Z>>
getWithReturningQuery
(ReturningObjectBuilder<Z> objectBuilder) javax.persistence.TypedQuery<ReturningResult<javax.persistence.Tuple>>
getWithReturningQuery
(String... attributes) <Z> javax.persistence.TypedQuery<ReturningResult<Z>>
getWithReturningQuery
(String attribute, Class<Z> type) with
(Class<?> cteClass, CriteriaBuilder<?> criteriaBuilder) withRecursive
(Class<?> cteClass) withReturning
(Class<?> cteClass) Methods inherited from class com.blazebit.persistence.impl.AbstractCommonQueryBuilder
afterKeyset, afterKeyset, afterKeyset, analyzeConstantifiedJoinNodes, appendGroupByClause, appendOrderByClause, appendSelectClause, appendWhereClause, appendWhereClause, appendWindowClause, applyExpressionTransformersAndBuildGroupByClauses, applyImplicitJoins, applyJpaLimit, applyObjectBuilder, applyVisitor, asExpression, asExpression, beforeKeyset, beforeKeyset, beforeKeyset, buildBaseQueryString, buildBaseQueryString, buildBaseQueryString0, buildExternalQueryString, buildExternalQueryString, buildImplicitGroupByClauses, buildLateralBaseQueryString, buildLateralExampleQueryString, checkJoinPreconditions, collectEntityFunctionNodes, collectEntityFunctionNodes, collectEntityFunctionNodes, collectEntityFunctionNodes, collectParameters, containsParameter, createFinalSetOperationBuilder, createSetOperand, createSubquerySetOperand, distinct, except, exceptAll, from, from, from, from, from, from, fromCte, fromCte, fromEntitySubquery, fromEntitySubquery, fromEntitySubquery, fromIdentifiableValues, fromIdentifiableValues, fromIdentifiableValues, fromIdentifiableValues, fromNew, fromNew, fromOld, fromOld, fromSubquery, fromSubquery, fromValues, fromValues, fromValues, fromValues, getBaseQueryString, getBaseQueryStringWithCheck, getCriteriaBuilderFactory, getCteNodes, getEntityFunctionNodes, getEntityFunctionNodes, getEntityManager, getExternalQueryString, getFirstResult, getFrom, getFromByPath, getGroupByIdentifierExpressions, getKeyRestrictedLeftJoinAliases, getKeyRestrictedLeftJoins, getLateralQuery, getMaxResults, getMetamodel, getParameter, getParameters, getParameterValue, getPath, getProperties, getProperty, getQueryString, getRequiredPath, getResultType, getRoot, getRoots, getService, getStatementType, getTypedQuery, getTypedQueryForFinalOperationBuilder, groupBy, groupBy, groupByCube, groupByCube, groupByGroupingSets, groupByRollup, groupByRollup, hasCte, hasCte, hasLimit, having, having, havingCase, havingExists, havingExists, havingExpression, havingExpressionSubqueries, havingNotExists, havingNotExists, havingOr, havingSimpleCase, havingSubqueries, havingSubquery, havingSubquery, havingSubquery, havingSubquery, implicitJoinWhereClause, innerJoin, innerJoinDefault, innerJoinDefaultOn, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinOn, innerJoinOn, innerJoinOn, innerJoinOn, innerJoinOn, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnSubquery, innerJoinOnSubquery, innerJoinOnSubquery, innerJoinOnSubquery, intersect, intersectAll, isCacheable, isEmpty, isEmpty, isJoinRequiredForSelect, isParameterSet, join, joinDefault, joinDefaultOn, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralSubquery, joinLateralSubquery, joinLateralSubquery, joinLateralSubquery, joinLateralSubquery, joinOn, joinOn, joinOn, joinOn, joinOn, joinOn, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnSubquery, joinOnSubquery, joinOnSubquery, joinOnSubquery, leftJoin, leftJoinDefault, leftJoinDefaultOn, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinOn, leftJoinOn, leftJoinOn, leftJoinOn, leftJoinOn, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnSubquery, leftJoinOnSubquery, leftJoinOnSubquery, leftJoinOnSubquery, needsSqlReplacement, orderBy, orderBy, orderByAsc, orderByAsc, orderByDesc, orderByDesc, prepareAndCheck, prepareAndCheckCtes, prepareForModification, prepareSelect, registerCriteriaParameter, registerMacro, renderCteNodes, rightJoin, rightJoinDefault, rightJoinDefaultOn, rightJoinOn, rightJoinOn, rightJoinOn, rightJoinOn, rightJoinOn, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnSubquery, rightJoinOnSubquery, rightJoinOnSubquery, rightJoinOnSubquery, select, select, selectCase, selectCase, selectSimpleCase, selectSimpleCase, selectSubqueries, selectSubqueries, selectSubquery, selectSubquery, selectSubquery, selectSubquery, selectSubquery, selectSubquery, selectSubquery, selectSubquery, setCacheable, setFirstResult, setHavingExpression, setHavingExpressionSubqueries, setMaxResults, setParameter, setParameter, setParameter, setParameterType, setProperties, setProperty, setWhereExpression, setWhereExpressionSubqueries, startExcept, startExceptAll, startIntersect, startIntersectAll, startSet, startUnion, startUnionAll, union, unionAll, verifyBuilderEnded, verifySetBuilderEnded, where, where, whereCase, whereExists, whereExists, whereExpression, whereExpressionSubqueries, whereNotExists, whereNotExists, whereOr, whereSimpleCase, whereSubqueries, whereSubquery, whereSubquery, whereSubquery, whereSubquery, window, with, with, with, with, with, with, with, with, with, with, withCtesFrom, withRecursive, withReturning, withStartSet, withStartSet, withStartSet, withStartSet, withStartSet, withStartSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.blazebit.persistence.BaseWhereBuilder
where, whereCase, whereExists, whereExists, whereExpression, whereExpressionSubqueries, whereNotExists, whereNotExists, whereSimpleCase, whereSubqueries, whereSubquery, whereSubquery, whereSubquery, whereSubquery
Methods inherited from interface com.blazebit.persistence.FromBaseBuilder
fromEntitySubquery, fromEntitySubquery, fromEntitySubquery, fromSubquery, fromSubquery
Methods inherited from interface com.blazebit.persistence.FromBuilder
from, from, from, from, fromIdentifiableValues, fromIdentifiableValues, fromIdentifiableValues, fromIdentifiableValues, fromNew, fromNew, fromOld, fromOld, fromValues, fromValues, fromValues, fromValues, getFrom, getFromByPath, getPath, getRequiredPath, getRoots, innerJoin, innerJoinDefault, innerJoinDefaultOn, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinOn, innerJoinOn, innerJoinOn, innerJoinOn, innerJoinOn, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnSubquery, innerJoinOnSubquery, innerJoinOnSubquery, innerJoinOnSubquery, join, joinDefault, joinDefaultOn, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralSubquery, joinLateralSubquery, joinLateralSubquery, joinLateralSubquery, joinLateralSubquery, joinOn, joinOn, joinOn, joinOn, joinOn, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnSubquery, joinOnSubquery, joinOnSubquery, joinOnSubquery, leftJoin, leftJoinDefault, leftJoinDefaultOn, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinOn, leftJoinOn, leftJoinOn, leftJoinOn, leftJoinOn, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnSubquery, leftJoinOnSubquery, leftJoinOnSubquery, leftJoinOnSubquery, rightJoin, rightJoinDefault, rightJoinDefaultOn, rightJoinOn, rightJoinOn, rightJoinOn, rightJoinOn, rightJoinOn, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnSubquery, rightJoinOnSubquery, rightJoinOnSubquery, rightJoinOnSubquery
Methods inherited from interface com.blazebit.persistence.WhereBuilder
setWhereExpression, setWhereExpressionSubqueries, where, whereOr
-
Field Details
-
entityType
-
entityAlias
-
cteType
protected final javax.persistence.metamodel.EntityType<?> cteType -
cteKey
protected final com.blazebit.persistence.impl.CTEManager.CTEKey cteKey -
result
-
listener
-
isReturningEntityAliasAllowed
protected final boolean isReturningEntityAliasAllowed -
returningAttributes
-
returningAttributeBindingMap
-
attributeEntries
-
columnBindingMap
-
-
Constructor Details
-
AbstractModificationCriteriaBuilder
public AbstractModificationCriteriaBuilder(MainQuery mainQuery, QueryContext queryContext, boolean isMainQuery, DbmsStatementType statementType, Class<T> clazz, String alias, com.blazebit.persistence.impl.CTEManager.CTEKey cteKey, Class<?> cteClass, Y result, CTEBuilderListener listener) -
AbstractModificationCriteriaBuilder
public AbstractModificationCriteriaBuilder(AbstractModificationCriteriaBuilder<T, X, Y> builder, MainQuery mainQuery, QueryContext queryContext, Map<JoinManager, JoinManager> joinManagerMapping, ExpressionCopyContext copyContext)
-
-
Method Details
-
with
- Overrides:
with
in classAbstractCommonQueryBuilder<T,
X extends BaseModificationCriteriaBuilder<X>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, BaseFinalSetOperationBuilderImpl<T, ?, ?>>
-
with
- Overrides:
with
in classAbstractCommonQueryBuilder<T,
X extends BaseModificationCriteriaBuilder<X>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, BaseFinalSetOperationBuilderImpl<T, ?, ?>>
-
withRecursive
- Overrides:
withRecursive
in classAbstractCommonQueryBuilder<T,
X extends BaseModificationCriteriaBuilder<X>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, BaseFinalSetOperationBuilderImpl<T, ?, ?>>
-
withReturning
- Overrides:
withReturning
in classAbstractCommonQueryBuilder<T,
X extends BaseModificationCriteriaBuilder<X>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, BaseFinalSetOperationBuilderImpl<T, ?, ?>>
-
applyJpaReturning
-
getQuery
public javax.persistence.Query getQuery()- Overrides:
getQuery
in classAbstractCommonQueryBuilder<T,
X extends BaseModificationCriteriaBuilder<X>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, BaseFinalSetOperationBuilderImpl<T, ?, ?>>
-
getQuery
protected javax.persistence.Query getQuery(Map<DbmsModificationState, String> includedModificationStates) - Overrides:
getQuery
in classAbstractCommonQueryBuilder<T,
X extends BaseModificationCriteriaBuilder<X>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, BaseFinalSetOperationBuilderImpl<T, ?, ?>>
-
executeUpdate
public int executeUpdate() -
getModificationStates
protected Map<DbmsModificationState,String> getModificationStates(Map<Class<?>, Map<String, DbmsModificationState>> explicitVersionEntities) - Overrides:
getModificationStates
in classAbstractCommonQueryBuilder<T,
X extends BaseModificationCriteriaBuilder<X>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, BaseFinalSetOperationBuilderImpl<T, ?, ?>>
-
getModificationStateRelatedTableNameRemappings
protected Map<String,String> getModificationStateRelatedTableNameRemappings(Map<Class<?>, Map<String, DbmsModificationState>> explicitVersionEntities) - Overrides:
getModificationStateRelatedTableNameRemappings
in classAbstractCommonQueryBuilder<T,
X extends BaseModificationCriteriaBuilder<X>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, AbstractCommonQueryBuilder<?, ?, ?, ?, ?>, BaseFinalSetOperationBuilderImpl<T, ?, ?>>
-
executeWithReturning
-
getWithReturningQuery
public javax.persistence.TypedQuery<ReturningResult<javax.persistence.Tuple>> getWithReturningQuery(String... attributes) -
executeWithReturning
-
getWithReturningQuery
public <Z> javax.persistence.TypedQuery<ReturningResult<Z>> getWithReturningQuery(String attribute, Class<Z> type) -
executeWithReturning
-
getWithReturningQuery
public <Z> javax.persistence.TypedQuery<ReturningResult<Z>> getWithReturningQuery(ReturningObjectBuilder<Z> objectBuilder) -
getExecuteWithReturningQuery
protected <R> javax.persistence.TypedQuery<ReturningResult<R>> getExecuteWithReturningQuery(javax.persistence.TypedQuery<Object[]> exampleQuery, javax.persistence.Query baseQuery, String[] returningColumns, ReturningObjectBuilder<R> objectBuilder) -
returning
- Specified by:
returning
in interfaceSimpleReturningBuilder
-
returning
-
end
-
createCTEInfo
public com.blazebit.persistence.impl.CTEInfo createCTEInfo()- Specified by:
createCTEInfo
in interfaceCTEInfoBuilder
-
getReturningColumns
-
getCountExampleQuery
protected javax.persistence.Query getCountExampleQuery() -
prepareAndGetAttributes
-
prepareAndGetColumnNames
-
getIdColumns
-