Interface SqmMultiTableInsertStrategy
- All Known Implementing Classes:
CteInsertStrategy
,GlobalTemporaryTableInsertStrategy
,LocalTemporaryTableInsertStrategy
,PersistentTableInsertStrategy
public interface SqmMultiTableInsertStrategy
Pluggable strategy for defining how insertion (`INSERT`) queries should be handled when the target
entity is mapped to multiple tables via secondary tables or certain inheritance strategies or uses an
identifier generator that uses an optimizer.
prepare(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess, org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess)
and release(org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess)
allow the strategy to perform any one time preparation and cleanup.
- API Note:
- See
SqmMultiTableMutationStrategyProvider.createInsertStrategy(org.hibernate.metamodel.mapping.EntityMappingType, org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess)
for standard resolution of the strategy to use for each hierarchy
-
Method Summary
Modifier and TypeMethodDescriptionint
executeInsert
(SqmInsertStatement<?> sqmInsertStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context) Execute the multi-table insert indicated by the passed SqmInsertStatementdefault void
prepare
(MappingModelCreationProcess mappingModelCreationProcess, JdbcConnectionAccess connectionAccess) Prepare the strategy for use.default void
release
(SessionFactoryImplementor sessionFactory, JdbcConnectionAccess connectionAccess) Release the strategy.
-
Method Details
-
prepare
default void prepare(MappingModelCreationProcess mappingModelCreationProcess, JdbcConnectionAccess connectionAccess) 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. -
executeInsert
int executeInsert(SqmInsertStatement<?> sqmInsertStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context) Execute the multi-table insert indicated by the passed SqmInsertStatement- Returns:
- The number of rows affected
-