Top Description Methods
org.hibernate.query.sqm.mutation.spi

public Interface SqmMultiTableInsertStrategy

Known Direct Implementers
org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy, org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy, org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy, org.hibernate.query.sqm.mutation.internal.temptable.PersistentTableInsertStrategy
Imports
org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess, org.hibernate.query.spi.DomainQueryExecutionContext, org.hibernate.query.sqm.internal.DomainParameterXref, org.hibernate.query.sqm.mutation.internal.SqmMutationStrategyHelper, org.hibernate.query.sqm.tree.insert.SqmInsertStatement

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 and release allow the strategy to perform any one time preparation and cleanup.

API Note

See SqmMutationStrategyHelper#resolveStrategy for standard resolution of the strategy to use for each hierarchy

Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The number of rows affected
executeInsert
(SqmInsertStatement<?> sqmInsertStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context)

Execute the multi-table insert indicated by the passed SqmInsertStatement

public default void
prepare(MappingModelCreationProcess mappingModelCreationProcess, JdbcConnectionAccess connectionAccess)

Prepare the strategy for use.

public default void
release(SessionFactoryImplementor sessionFactory, JdbcConnectionAccess connectionAccess)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Release the strategy.

Method Detail

executeInsertback to summary
public int executeInsert(SqmInsertStatement<?> sqmInsertStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context)

Execute the multi-table insert indicated by the passed SqmInsertStatement

Returns:int

The number of rows affected

prepareback to summary
public default void prepare(MappingModelCreationProcess mappingModelCreationProcess, JdbcConnectionAccess connectionAccess)

Prepare the strategy for use. Called one time as the SessionFactory is being built.

releaseback to summary
public default void release(SessionFactoryImplementor sessionFactory, JdbcConnectionAccess connectionAccess)

Deprecated

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

Release the strategy. Called one time as the SessionFactory is being shut down.