Package org.hibernate.hql.spi.id.cte
Class CteValuesListBulkIdStrategy
- java.lang.Object
-
- org.hibernate.hql.spi.id.cte.CteValuesListBulkIdStrategy
-
- All Implemented Interfaces:
MultiTableBulkIdStrategy
public class CteValuesListBulkIdStrategy extends java.lang.Object implements MultiTableBulkIdStrategy
This bulk-id strategy uses a CTE with a VALUE list to hold the identifiers, which are later used by the update or delete statement:with HT_Person (id ) as ( select id from ( values (?), (?), (?) (?) ) as HT (id) ) delete from Person where ( id ) in ( select id from HT_Person )
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.hql.spi.id.MultiTableBulkIdStrategy
MultiTableBulkIdStrategy.DeleteHandler, MultiTableBulkIdStrategy.UpdateHandler
-
-
Field Summary
Fields Modifier and Type Field Description static CteValuesListBulkIdStrategy
INSTANCE
-
Constructor Summary
Constructors Constructor Description CteValuesListBulkIdStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiTableBulkIdStrategy.DeleteHandler
buildDeleteHandler(SessionFactoryImplementor factory, org.hibernate.hql.internal.ast.HqlSqlWalker walker)
Build a handler capable of handling the bulk delete indicated by the given walker.MultiTableBulkIdStrategy.UpdateHandler
buildUpdateHandler(SessionFactoryImplementor factory, org.hibernate.hql.internal.ast.HqlSqlWalker walker)
Build a handler capable of handling the bulk update indicated by the given walker.void
prepare(JdbcServices jdbcServices, JdbcConnectionAccess jdbcConnectionAccess, MetadataImplementor metadataImplementor, SessionFactoryOptions sessionFactoryOptions, SqlStringGenerationContext sqlStringGenerationContext)
Prepare the strategy.void
release(JdbcServices jdbcServices, JdbcConnectionAccess connectionAccess)
Release the strategy.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.hql.spi.id.MultiTableBulkIdStrategy
prepare
-
-
-
-
Field Detail
-
INSTANCE
public static final CteValuesListBulkIdStrategy INSTANCE
-
-
Method Detail
-
prepare
public void prepare(JdbcServices jdbcServices, JdbcConnectionAccess jdbcConnectionAccess, MetadataImplementor metadataImplementor, SessionFactoryOptions sessionFactoryOptions, SqlStringGenerationContext sqlStringGenerationContext)
Description copied from interface:MultiTableBulkIdStrategy
Prepare the strategy. Called as the SessionFactory is being built. Intended patterns here include:- Adding tables to the passed Mappings, to be picked by by "schema management tools"
- Manually creating the tables immediately through the passed JDBC Connection access
- Specified by:
prepare
in interfaceMultiTableBulkIdStrategy
- Parameters:
jdbcServices
- The JdbcService objectjdbcConnectionAccess
- Access to the JDBC ConnectionmetadataImplementor
- Access to the O/RM mapping information
-
release
public void release(JdbcServices jdbcServices, JdbcConnectionAccess connectionAccess)
Description copied from interface:MultiTableBulkIdStrategy
Release the strategy. Called as the SessionFactory is being shut down.- Specified by:
release
in interfaceMultiTableBulkIdStrategy
- Parameters:
jdbcServices
- The JdbcService objectconnectionAccess
- Access to the JDBC Connection
-
buildUpdateHandler
public MultiTableBulkIdStrategy.UpdateHandler buildUpdateHandler(SessionFactoryImplementor factory, org.hibernate.hql.internal.ast.HqlSqlWalker walker)
Description copied from interface:MultiTableBulkIdStrategy
Build a handler capable of handling the bulk update indicated by the given walker.- Specified by:
buildUpdateHandler
in interfaceMultiTableBulkIdStrategy
- Parameters:
factory
- The SessionFactorywalker
- The AST walker, representing the update query- Returns:
- The handler
-
buildDeleteHandler
public MultiTableBulkIdStrategy.DeleteHandler buildDeleteHandler(SessionFactoryImplementor factory, org.hibernate.hql.internal.ast.HqlSqlWalker walker)
Description copied from interface:MultiTableBulkIdStrategy
Build a handler capable of handling the bulk delete indicated by the given walker.- Specified by:
buildDeleteHandler
in interfaceMultiTableBulkIdStrategy
- Parameters:
factory
- The SessionFactorywalker
- The AST walker, representing the delete query- Returns:
- The handler
-
-