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 voidaddDmlCtes(CteContainer statement, CteStatement idSelectCte, MultiTableSqmMutationConverter sqmConverter, Map<SqmParameter<?>, List<JdbcParameter>> parameterResolutions, SessionFactoryImplementor factory) protected ExpressioncreateCountStar(SessionFactoryImplementor factory, MultiTableSqmMutationConverter sqmConverter) Used by Hibernate Reactiveprotected QuerySpeccreateIdSubQuery(CteStatement idSelectCte, ModelPart fkModelPart, SessionFactoryImplementor factory) protected PredicatecreateIdSubQueryPredicate(List<? extends Expression> lhsExpressions, CteStatement idSelectCte, SessionFactoryImplementor factory) protected PredicatecreateIdSubQueryPredicate(List<? extends Expression> lhsExpressions, CteStatement idSelectCte, ModelPart fkModelPart, SessionFactoryImplementor factory) Create theJdbcParameterBindingsfor this multi-table handler based on the execution context.booleanSignals that the SQL depends on the parameter bindings e.g.intexecute(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 StringgetCteTableName(String tableExpression) protected JdbcOperationQuerySelectbooleanisCompatibleWith(JdbcParameterBindings jdbcParameterBindings, QueryOptions queryOptions) protected NamedTableReferenceresolveUnionTableReference(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:MultiTableHandlerCreate theJdbcParameterBindingsfor 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:MultiTableHandlerSignals 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:MultiTableHandlerExecute 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
-