Top Fields Constructors Methods
org.hibernate.query.sqm.mutation.internal.temptable

public Class UpdateExecutionDelegate

extends Object
implements ExecutionDelegate
Class Inheritance
All Implemented Interfaces
org.hibernate.query.sqm.mutation.internal.temptable.TableBasedUpdateHandler.ExecutionDelegate
Imports
java.util.ArrayList, .Collection, .List, .Map, java.util.function.Consumer, .Function, .Supplier, org.hibernate.boot.model.internal.SoftDeleteHelper, org.hibernate.dialect.temptable.TemporaryTable, org.hibernate.engine.jdbc.spi.JdbcServices, org.hibernate.engine.spi.SessionFactoryImplementor, .SharedSessionContractImplementor, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.metamodel.mapping.EntityMappingType, .MappingModelExpressible, .ModelPartContainer, .SelectableConsumer, .SoftDeleteMapping, org.hibernate.persister.entity.AbstractEntityPersister, org.hibernate.query.SemanticException, org.hibernate.query.results.TableGroupImpl, org.hibernate.query.spi.DomainQueryExecutionContext, org.hibernate.query.sqm.ComparisonOperator, org.hibernate.query.sqm.internal.DomainParameterXref, .SqmUtil, org.hibernate.query.sqm.mutation.internal.MultiTableSqmMutationConverter, .TableKeyExpressionCollector, org.hibernate.query.sqm.spi.SqmParameterMappingModelResolutionAccess, org.hibernate.query.sqm.tree.expression.SqmParameter, org.hibernate.sql.ast.SqlAstTranslatorFactory, org.hibernate.sql.ast.spi.SqlSelection, org.hibernate.sql.ast.tree.expression.ColumnReference, .Expression, .JdbcParameter, .QueryLiteral, .SqlTuple, org.hibernate.sql.ast.tree.from.NamedTableReference, .TableGroup, .TableReference, .UnionTableReference, org.hibernate.sql.ast.tree.insert.InsertSelectStatement, org.hibernate.sql.ast.tree.predicate.ComparisonPredicate, .ExistsPredicate, .InSubQueryPredicate, .Predicate, org.hibernate.sql.ast.tree.select.QuerySpec, .SelectClause, org.hibernate.sql.ast.tree.update.Assignment, .UpdateStatement, org.hibernate.sql.exec.spi.ExecutionContext, .JdbcMutationExecutor, .JdbcOperationQueryInsert, .JdbcOperationQueryMutation, .JdbcOperationQueryUpdate, .JdbcParameterBindings, org.hibernate.sql.results.internal.SqlSelectionImpl

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final AfterUseAction
private final Map<TableReference, List<Assignment>>
private final EntityMappingType
private final TemporaryTable
private final JdbcParameterBindings
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
private final Function<SharedSessionContractImplementor, String>
private final MultiTableSqmMutationConverter
private final Predicate
private final TableGroup

Constructor Summary

AccessConstructor and Description
public
UpdateExecutionDelegate(MultiTableSqmMutationConverter sqmConverter, TemporaryTable idTable, AfterUseAction afterUseAction, Function<SharedSessionContractImplementor, String> sessionUidAccess, DomainParameterXref domainParameterXref, TableGroup updatingTableGroup, Map<String, TableReference> tableReferenceByAlias, List<Assignment> assignments, Predicate suppliedPredicate, Map<SqmParameter<?>, List<List<JdbcParameter>>> parameterResolutions, Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions, DomainQueryExecutionContext executionContext)

Method Summary

Modifier and TypeMethod and Description
protected Expression
asExpression(SelectClause selectClause)

protected QuerySpec
createExistsSubQuerySpec(String targetTableExpression, Supplier<Consumer<SelectableConsumer>> tableKeyColumnVisitationSupplier, QuerySpec idTableSubQuery)

public int
private int
executeInsert(String targetTableExpression, NamedTableReference targetTableReference, Expression targetTableKeyExpression, Supplier<Consumer<SelectableConsumer>> tableKeyColumnVisitationSupplier, QuerySpec idTableSubQuery, List<Assignment> assignments, SqlAstTranslatorFactory sqlAstTranslatorFactory, JdbcMutationExecutor jdbcMutationExecutor, ExecutionContext executionContext)

private int
executeUpdate(QuerySpec idTableSubQuery, ExecutionContext executionContext, List<Assignment> assignments, NamedTableReference dmlTableReference, SqlAstTranslatorFactory sqlAstTranslatorFactory, JdbcMutationExecutor jdbcMutationExecutor, Expression keyExpression)

protected AfterUseAction
protected Map<TableReference, List<Assignment>>
protected EntityMappingType
protected TemporaryTable
getIdTable()

For Hibernate Reactive

protected JdbcParameterBindings
protected SessionFactoryImplementor
getSessionFactory()

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
protected Function<SharedSessionContractImplementor, String>
protected MultiTableSqmMutationConverter
protected Predicate
protected TableGroup
protected boolean
isTableOptional(String tableExpression)

protected static QuerySpec
protected Expression
resolveMutatingTableKeyExpression(String tableExpression, Supplier<Consumer<SelectableConsumer>> tableKeyColumnVisitationSupplier)

protected TableReference
resolveTableReference(ColumnReference columnReference, Map<String, TableReference> tableReferenceByAlias)

protected NamedTableReference
resolveUnionTableReference(TableReference tableReference, String tableExpression)

private void
updateTable(String tableExpression, Supplier<Consumer<SelectableConsumer>> tableKeyColumnVisitationSupplier, int expectedUpdateCount, QuerySpec idTableSubQuery, ExecutionContext executionContext)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

afterUseActionback to summary
private final AfterUseAction afterUseAction
assignmentsByTableback to summary
private final Map<TableReference, List<Assignment>> assignmentsByTable
entityDescriptorback to summary
private final EntityMappingType entityDescriptor
idTableback to summary
private final TemporaryTable idTable
jdbcParameterBindingsback to summary
private final JdbcParameterBindings jdbcParameterBindings
sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

sessionUidAccessback to summary
private final Function<SharedSessionContractImplementor, String> sessionUidAccess
sqmConverterback to summary
private final MultiTableSqmMutationConverter sqmConverter
suppliedPredicateback to summary
private final Predicate suppliedPredicate
updatingTableGroupback to summary
private final TableGroup updatingTableGroup

Constructor Detail

UpdateExecutionDelegateback to summary
public UpdateExecutionDelegate(MultiTableSqmMutationConverter sqmConverter, TemporaryTable idTable, AfterUseAction afterUseAction, Function<SharedSessionContractImplementor, String> sessionUidAccess, DomainParameterXref domainParameterXref, TableGroup updatingTableGroup, Map<String, TableReference> tableReferenceByAlias, List<Assignment> assignments, Predicate suppliedPredicate, Map<SqmParameter<?>, List<List<JdbcParameter>>> parameterResolutions, Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions, DomainQueryExecutionContext executionContext)

Method Detail

asExpressionback to summary
protected Expression asExpression(SelectClause selectClause)
createExistsSubQuerySpecback to summary
protected QuerySpec createExistsSubQuerySpec(String targetTableExpression, Supplier<Consumer<SelectableConsumer>> tableKeyColumnVisitationSupplier, QuerySpec idTableSubQuery)
executeback to summary
public int execute(ExecutionContext executionContext)

Implements org.hibernate.query.sqm.mutation.internal.temptable.TableBasedUpdateHandler.ExecutionDelegate.execute.

Annotations
@Override
executeInsertback to summary
private int executeInsert(String targetTableExpression, NamedTableReference targetTableReference, Expression targetTableKeyExpression, Supplier<Consumer<SelectableConsumer>> tableKeyColumnVisitationSupplier, QuerySpec idTableSubQuery, List<Assignment> assignments, SqlAstTranslatorFactory sqlAstTranslatorFactory, JdbcMutationExecutor jdbcMutationExecutor, ExecutionContext executionContext)
executeUpdateback to summary
private int executeUpdate(QuerySpec idTableSubQuery, ExecutionContext executionContext, List<Assignment> assignments, NamedTableReference dmlTableReference, SqlAstTranslatorFactory sqlAstTranslatorFactory, JdbcMutationExecutor jdbcMutationExecutor, Expression keyExpression)
getAfterUseActionback to summary
protected AfterUseAction getAfterUseAction()
getAssignmentsByTableback to summary
protected Map<TableReference, List<Assignment>> getAssignmentsByTable()
getEntityDescriptorback to summary
protected EntityMappingType getEntityDescriptor()
getIdTableback to summary
protected TemporaryTable getIdTable()

For Hibernate Reactive

getJdbcParameterBindingsback to summary
protected JdbcParameterBindings getJdbcParameterBindings()
getSessionFactoryback to summary
protected SessionFactoryImplementor getSessionFactory()

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

getSessionUidAccessback to summary
protected Function<SharedSessionContractImplementor, String> getSessionUidAccess()
getSqmConverterback to summary
protected MultiTableSqmMutationConverter getSqmConverter()
getSuppliedPredicateback to summary
protected Predicate getSuppliedPredicate()
getUpdatingTableGroupback to summary
protected TableGroup getUpdatingTableGroup()
isTableOptionalback to summary
protected boolean isTableOptional(String tableExpression)
makeInsertSourceSelectQuerySpecback to summary
protected static QuerySpec makeInsertSourceSelectQuerySpec(QuerySpec idTableSubQuery)
resolveMutatingTableKeyExpressionback to summary
protected Expression resolveMutatingTableKeyExpression(String tableExpression, Supplier<Consumer<SelectableConsumer>> tableKeyColumnVisitationSupplier)
resolveTableReferenceback to summary
protected TableReference resolveTableReference(ColumnReference columnReference, Map<String, TableReference> tableReferenceByAlias)
resolveUnionTableReferenceback to summary
protected NamedTableReference resolveUnionTableReference(TableReference tableReference, String tableExpression)
updateTableback to summary
private void updateTable(String tableExpression, Supplier<Consumer<SelectableConsumer>> tableKeyColumnVisitationSupplier, int expectedUpdateCount, QuerySpec idTableSubQuery, ExecutionContext executionContext)