Class AbstractCteMutationHandler
java.lang.Object
org.hibernate.query.sqm.mutation.internal.AbstractMutationHandler
org.hibernate.query.sqm.mutation.internal.cte.AbstractCteMutationHandler
- All Implemented Interfaces:
Handler
,MultiTableHandler
- Direct Known Subclasses:
CteDeleteHandler
,CteUpdateHandler
Defines how identifier values are selected from the updatable/deletable tables.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCteMutationHandler
(CteTable cteTable, SqmDeleteOrUpdateStatement<?> sqmStatement, DomainParameterXref domainParameterXref, CteMutationStrategy strategy, SessionFactoryImplementor sessionFactory, DomainQueryExecutionContext context, MutableObject<JdbcParameterBindings> firstJdbcParameterBindingsConsumer) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addDmlCtes
(CteContainer statement, CteStatement idSelectCte, MultiTableSqmMutationConverter sqmConverter, Map<SqmParameter<?>, List<JdbcParameter>> parameterResolutions, SessionFactoryImplementor factory) protected Expression
createCountStar
(SessionFactoryImplementor factory, MultiTableSqmMutationConverter sqmConverter) Used by Hibernate Reactiveprotected QuerySpec
createIdSubQuery
(CteStatement idSelectCte, ModelPart fkModelPart, SessionFactoryImplementor factory) protected Predicate
createIdSubQueryPredicate
(List<? extends Expression> lhsExpressions, CteStatement idSelectCte, SessionFactoryImplementor factory) protected Predicate
createIdSubQueryPredicate
(List<? extends Expression> lhsExpressions, CteStatement idSelectCte, ModelPart fkModelPart, SessionFactoryImplementor factory) Create theJdbcParameterBindings
for this multi-table handler based on the execution context.boolean
Signals that the SQL depends on the parameter bindings e.g.int
execute
(JdbcParameterBindings jdbcParameterBindings, DomainQueryExecutionContext executionContext) Execute the multi-table update or delete indicated by the SQM AST passed in when this Handler was created.protected abstract String
getCteTableName
(String tableExpression) protected JdbcOperationQuerySelect
boolean
isCompatibleWith
(JdbcParameterBindings jdbcParameterBindings, QueryOptions queryOptions) protected NamedTableReference
resolveUnionTableReference
(TableReference tableReference, String tableExpression) Methods inherited from class org.hibernate.query.sqm.mutation.internal.AbstractMutationHandler
getEntityDescriptor, getSessionFactory, getSqmStatement
-
Field Details
-
CTE_TABLE_IDENTIFIER
- See Also:
-
-
Constructor Details
-
AbstractCteMutationHandler
public AbstractCteMutationHandler(CteTable cteTable, SqmDeleteOrUpdateStatement<?> sqmStatement, DomainParameterXref domainParameterXref, CteMutationStrategy strategy, SessionFactoryImplementor sessionFactory, DomainQueryExecutionContext context, MutableObject<JdbcParameterBindings> firstJdbcParameterBindingsConsumer)
-
-
Method Details
-
createJdbcParameterBindings
Description copied from interface:MultiTableHandler
Create theJdbcParameterBindings
for this multi-table handler based on the execution context.- Parameters:
context
- Contextual information needed for execution- Returns:
- The built parameter bindings
-
dependsOnParameterBindings
public boolean dependsOnParameterBindings()Description copied from interface:MultiTableHandler
Signals that the SQL depends on the parameter bindings e.g. due to the need for inlining of parameter values or multiValued parameters. -
isCompatibleWith
public boolean isCompatibleWith(JdbcParameterBindings jdbcParameterBindings, QueryOptions queryOptions) -
execute
public int execute(JdbcParameterBindings jdbcParameterBindings, DomainQueryExecutionContext executionContext) Description copied from interface:MultiTableHandler
Execute the multi-table update or delete indicated by the SQM AST passed in when this Handler was created.- Parameters:
jdbcParameterBindings
- The parameter bindings for JDBC parametersexecutionContext
- Contextual information needed for execution- Returns:
- The "number of rows affected" count
-
getSelect
-
createCountStar
protected Expression createCountStar(SessionFactoryImplementor factory, MultiTableSqmMutationConverter sqmConverter) Used by Hibernate Reactive -
createIdSubQueryPredicate
protected Predicate createIdSubQueryPredicate(List<? extends Expression> lhsExpressions, CteStatement idSelectCte, SessionFactoryImplementor factory) -
createIdSubQueryPredicate
protected Predicate createIdSubQueryPredicate(List<? extends Expression> lhsExpressions, CteStatement idSelectCte, ModelPart fkModelPart, SessionFactoryImplementor factory) -
createIdSubQuery
protected QuerySpec createIdSubQuery(CteStatement idSelectCte, ModelPart fkModelPart, SessionFactoryImplementor factory) -
addDmlCtes
protected abstract void addDmlCtes(CteContainer statement, CteStatement idSelectCte, MultiTableSqmMutationConverter sqmConverter, Map<SqmParameter<?>, List<JdbcParameter>> parameterResolutions, SessionFactoryImplementor factory) -
resolveUnionTableReference
protected NamedTableReference resolveUnionTableReference(TableReference tableReference, String tableExpression) -
getCteTableName
-