Interface SqmMultiTableMutationStrategy
public interface SqmMultiTableMutationStrategy
Pluggable strategy for defining how mutation (
UPDATE or DELETE) queries should
be handled when the target entity is mapped to multiple tables via secondary tables or certain
inheritance strategies.
The main contracts here are executeUpdate(SqmUpdateStatement, DomainParameterXref, DomainQueryExecutionContext) and executeDelete(SqmDeleteStatement, DomainParameterXref, DomainQueryExecutionContext).
The methods prepare(MappingModelCreationProcess, JdbcConnectionAccess) and release(SessionFactoryImplementor, JdbcConnectionAccess) allow the strategy to perform any one time
preparation and cleanup.
- API Note:
- See
SqmMultiTableMutationStrategyProvider.createMutationStrategy(EntityMappingType, MappingModelCreationProcess)for standard resolution of the strategy to use for each hierarchy.
-
Method Summary
Modifier and TypeMethodDescriptionbuildHandler(SqmDeleteOrUpdateStatement<?> sqmStatement, org.hibernate.query.sqm.internal.DomainParameterXref domainParameterXref, DomainQueryExecutionContext context) Builds a cacheable handler for the passed SqmDeleteOrUpdateStatement.default intexecuteDelete(SqmDeleteStatement<?> sqmDeleteStatement, org.hibernate.query.sqm.internal.DomainParameterXref domainParameterXref, DomainQueryExecutionContext context) Deprecated, for removal: This API element is subject to removal in a future version.default intexecuteUpdate(SqmUpdateStatement<?> sqmUpdateStatement, org.hibernate.query.sqm.internal.DomainParameterXref domainParameterXref, DomainQueryExecutionContext context) Deprecated, for removal: This API element is subject to removal in a future version.default voidprepare(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess mappingModelCreationProcess) Prepare the strategy for use.default voidprepare(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess mappingModelCreationProcess, JdbcConnectionAccess connectionAccess) Prepare the strategy for use.default voidrelease(SessionFactoryImplementor sessionFactory, JdbcConnectionAccess connectionAccess) Release the strategy.
-
Method Details
-
prepare
default void prepare(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess mappingModelCreationProcess, JdbcConnectionAccess connectionAccess) Prepare the strategy for use. Called one time as the SessionFactory is being built. -
prepare
default void prepare(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess mappingModelCreationProcess) Prepare the strategy for use. Called one time as the SessionFactory is being built. -
release
default void release(SessionFactoryImplementor sessionFactory, JdbcConnectionAccess connectionAccess) Release the strategy. Called one time as the SessionFactory is being shut down. -
buildHandler
MultiTableHandlerBuildResult buildHandler(SqmDeleteOrUpdateStatement<?> sqmStatement, org.hibernate.query.sqm.internal.DomainParameterXref domainParameterXref, DomainQueryExecutionContext context) Builds a cacheable handler for the passed SqmDeleteOrUpdateStatement.- Returns:
- The number of rows affected
-
executeUpdate
@Deprecated(forRemoval=true, since="7.1") default int executeUpdate(SqmUpdateStatement<?> sqmUpdateStatement, org.hibernate.query.sqm.internal.DomainParameterXref domainParameterXref, DomainQueryExecutionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Execute the multi-table update indicated by the passed SqmUpdateStatement- Returns:
- The number of rows affected
-
executeDelete
@Deprecated(forRemoval=true, since="7.1") default int executeDelete(SqmDeleteStatement<?> sqmDeleteStatement, org.hibernate.query.sqm.internal.DomainParameterXref domainParameterXref, DomainQueryExecutionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Execute the multi-table update indicated by the passed SqmUpdateStatement- Returns:
- The number of rows affected
-
buildHandler(SqmDeleteOrUpdateStatement, DomainParameterXref, DomainQueryExecutionContext)instead