diff --git a/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/internal/StrategySelectorBuilder.java b/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/internal/StrategySelectorBuilder.java index 6404478a06..d24b50f3f1 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/internal/StrategySelectorBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/internal/StrategySelectorBuilder.java @@ -94,6 +94,9 @@ import org.hibernate.engine.transaction.jta.platform.internal.WebSphereJtaPlatfo import org.hibernate.engine.transaction.jta.platform.internal.WeblogicJtaPlatform; import org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform; import org.hibernate.engine.transaction.spi.TransactionFactory; +import org.hibernate.hql.spi.MultiTableBulkIdStrategy; +import org.hibernate.hql.spi.PersistentTableBulkIdStrategy; +import org.hibernate.hql.spi.TemporaryTableBulkIdStrategy; /** * @author Steve Ebersole @@ -131,6 +134,7 @@ public class StrategySelectorBuilder { addDialects( strategySelector ); addJtaPlatforms( strategySelector ); addTransactionFactories( strategySelector ); + addMultiTableBulkIdStrategies( strategySelector ); // apply auto-discovered registrations for ( AvailabilityAnnouncer announcer : classLoaderService.loadJavaServices( AvailabilityAnnouncer.class ) ) { @@ -327,4 +331,17 @@ public class StrategySelectorBuilder { strategySelector.registerStrategyImplementor( TransactionFactory.class, CMTTransactionFactory.SHORT_NAME, CMTTransactionFactory.class ); strategySelector.registerStrategyImplementor( TransactionFactory.class, "org.hibernate.transaction.CMTTransactionFactory", CMTTransactionFactory.class ); } + + private void addMultiTableBulkIdStrategies(StrategySelectorImpl strategySelector) { + strategySelector.registerStrategyImplementor( + MultiTableBulkIdStrategy.class, + PersistentTableBulkIdStrategy.SHORT_NAME, + PersistentTableBulkIdStrategy.class + ); + strategySelector.registerStrategyImplementor( + MultiTableBulkIdStrategy.class, + TemporaryTableBulkIdStrategy.SHORT_NAME, + TemporaryTableBulkIdStrategy.class + ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/hql/spi/PersistentTableBulkIdStrategy.java b/hibernate-core/src/main/java/org/hibernate/hql/spi/PersistentTableBulkIdStrategy.java index 1af7ff2e91..d0de8000db 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/spi/PersistentTableBulkIdStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/spi/PersistentTableBulkIdStrategy.java @@ -64,6 +64,8 @@ public class PersistentTableBulkIdStrategy implements MultiTableBulkIdStrategy { PersistentTableBulkIdStrategy.class.getName() ); + public static final String SHORT_NAME = "persistent"; + public static final String CLEAN_UP_ID_TABLES = "hibernate.hql.bulk_id_strategy.persistent.clean_up"; public static final String SCHEMA = "hibernate.hql.bulk_id_strategy.persistent.schema"; public static final String CATALOG = "hibernate.hql.bulk_id_strategy.persistent.catalog"; diff --git a/hibernate-core/src/main/java/org/hibernate/hql/spi/TemporaryTableBulkIdStrategy.java b/hibernate-core/src/main/java/org/hibernate/hql/spi/TemporaryTableBulkIdStrategy.java index d6ce9f28a4..3f118a9a3f 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/spi/TemporaryTableBulkIdStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/spi/TemporaryTableBulkIdStrategy.java @@ -49,6 +49,8 @@ import org.hibernate.persister.entity.Queryable; public class TemporaryTableBulkIdStrategy implements MultiTableBulkIdStrategy { public static final TemporaryTableBulkIdStrategy INSTANCE = new TemporaryTableBulkIdStrategy(); + public static final String SHORT_NAME = "temporary"; + private static final CoreMessageLogger log = Logger.getMessageLogger( CoreMessageLogger.class, TemporaryTableBulkIdStrategy.class.getName()