Top Description Fields Constructors Methods
org.hibernate.query.sqm.mutation.internal.inline

public Class InlineDeleteHandler

extends Object
implements DeleteHandler
Class Inheritance
All Implemented Interfaces
org.hibernate.query.sqm.mutation.internal.DeleteHandler, org.hibernate.query.sqm.mutation.internal.Handler
Imports
java.sql.PreparedStatement, java.util.Collections, .List, java.util.function.Consumer, .Supplier, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.internal.util.MutableInteger, org.hibernate.metamodel.mapping.EntityMappingType, .ModelPart, .SelectableConsumer, .SoftDeleteMapping, .TableDetails, org.hibernate.query.spi.DomainQueryExecutionContext, org.hibernate.query.sqm.internal.DomainParameterXref, .SqmJdbcExecutionContextAdapter, org.hibernate.query.sqm.mutation.internal.DeleteHandler, .MatchingIdSelectionHelper, .SqmMutationStrategyHelper, org.hibernate.query.sqm.tree.delete.SqmDeleteStatement, org.hibernate.sql.ast.SqlAstTranslatorFactory, org.hibernate.sql.ast.tree.delete.DeleteStatement, org.hibernate.sql.ast.tree.from.NamedTableReference, org.hibernate.sql.ast.tree.predicate.Predicate, org.hibernate.sql.ast.tree.update.Assignment, .UpdateStatement, org.hibernate.sql.exec.internal.JdbcParameterBindingsImpl, org.hibernate.sql.exec.spi.JdbcMutationExecutor, .JdbcOperationQueryMutation, .JdbcParameterBindings, .StatementCreatorHelper

DeleteHandler for the in-line strategy
Authors
Evandro Pires da Silva, Vlad Mihalcea, Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final DomainParameterXref
private final DomainQueryExecutionContext
private final JdbcMutationExecutor
private final MatchingIdRestrictionProducer
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
private final SqlAstTranslatorFactory
private final SqmDeleteStatement<?>

Constructor Summary

AccessConstructor and Description
protected
InlineDeleteHandler(MatchingIdRestrictionProducer matchingIdsPredicateProducer, SqmDeleteStatement<?> sqmDeleteStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context)

Method Summary

Modifier and TypeMethod and Description
public int
execute(DomainQueryExecutionContext
Contextual information needed for execution
executionContext
)

Implements org.hibernate.query.sqm.mutation.internal.Handler.execute.

Execute the multi-table update or delete indicated by the SQM AST passed in when this Handler was created.
private void
executeDelete(String targetTableExpression, EntityMappingType entityDescriptor, Supplier<Consumer<SelectableConsumer>> tableKeyColumnsVisitationSupplier, List<Object> ids, int valueIndex, ModelPart valueModelPart, JdbcParameterBindings jdbcParameterBindings, DomainQueryExecutionContext executionContext)

private void
performSoftDelete(EntityMappingType entityDescriptor, List<Object> idsAndFks, JdbcParameterBindings jdbcParameterBindings, DomainQueryExecutionContext executionContext)

Perform a soft-delete, which just needs to update the root table

private PreparedStatement
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

domainParameterXrefback to summary
private final DomainParameterXref domainParameterXref
executionContextback to summary
private final DomainQueryExecutionContext executionContext
jdbcMutationExecutorback to summary
private final JdbcMutationExecutor jdbcMutationExecutor
matchingIdsPredicateProducerback to summary
private final MatchingIdRestrictionProducer matchingIdsPredicateProducer
sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

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

sqlAstTranslatorFactoryback to summary
private final SqlAstTranslatorFactory sqlAstTranslatorFactory
sqmDeleteStatementback to summary
private final SqmDeleteStatement<?> sqmDeleteStatement

Constructor Detail

InlineDeleteHandlerback to summary
protected InlineDeleteHandler(MatchingIdRestrictionProducer matchingIdsPredicateProducer, SqmDeleteStatement<?> sqmDeleteStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context)

Method Detail

executeback to summary
public int execute(DomainQueryExecutionContext executionContext)

Implements org.hibernate.query.sqm.mutation.internal.Handler.execute.

Doc from org.hibernate.query.sqm.mutation.internal.Handler.execute.

Execute the multi-table update or delete indicated by the SQM AST passed in when this Handler was created.

Parameters
executionContext:DomainQueryExecutionContext

Contextual information needed for execution

Returns:int

The "number of rows affected" count

Annotations
@Override
executeDeleteback to summary
private void executeDelete(String targetTableExpression, EntityMappingType entityDescriptor, Supplier<Consumer<SelectableConsumer>> tableKeyColumnsVisitationSupplier, List<Object> ids, int valueIndex, ModelPart valueModelPart, JdbcParameterBindings jdbcParameterBindings, DomainQueryExecutionContext executionContext)
performSoftDeleteback to summary
private void performSoftDelete(EntityMappingType entityDescriptor, List<Object> idsAndFks, JdbcParameterBindings jdbcParameterBindings, DomainQueryExecutionContext executionContext)

Perform a soft-delete, which just needs to update the root table

prepareQueryStatementback to summary
private PreparedStatement prepareQueryStatement(String sql)