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

public Interface SqmMultiTableMutationStrategy

Known Direct Implementers
org.hibernate.query.sqm.mutation.internal.cte.CteMutationStrategy, org.hibernate.query.sqm.mutation.internal.inline.InlineMutationStrategy, org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy, org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy, org.hibernate.query.sqm.mutation.internal.temptable.PersistentTableMutationStrategy
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.delete.SqmDeleteStatement, org.hibernate.query.sqm.tree.update.SqmUpdateStatement

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 and executeDelete.

The methods 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
executeDelete
(SqmDeleteStatement<?> sqmDeleteStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context)

Execute the multi-table update indicated by the passed SqmUpdateStatement

public int

Returns:

The number of rows affected
executeUpdate
(SqmUpdateStatement<?> sqmUpdateStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context)

Execute the multi-table update indicated by the passed SqmUpdateStatement

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

executeDeleteback to summary
public int executeDelete(SqmDeleteStatement<?> sqmDeleteStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context)

Execute the multi-table update indicated by the passed SqmUpdateStatement

Returns:int

The number of rows affected

executeUpdateback to summary
public int executeUpdate(SqmUpdateStatement<?> sqmUpdateStatement, DomainParameterXref domainParameterXref, DomainQueryExecutionContext context)

Execute the multi-table update indicated by the passed SqmUpdateStatement

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.