HHH-7769 - Define short-names for built-in MultiTableBulkIdStrategy impls

This commit is contained in:
Steve Ebersole 2012-11-08 15:15:20 -06:00
parent 0ef75629b9
commit 0251d13adc
3 changed files with 12 additions and 1 deletions

View File

@ -384,7 +384,14 @@ public class SettingsFactory implements Serializable {
strategyClass = (Class) setting;
}
else {
strategyClass = classLoaderService.classForName( setting.toString() );
final String settingStr = setting.toString();
if ( PersistentTableBulkIdStrategy.SHORT_NAME.equals( settingStr ) ) {
return new PersistentTableBulkIdStrategy();
}
else if ( TemporaryTableBulkIdStrategy.SHORT_NAME.equals( settingStr ) ) {
return TemporaryTableBulkIdStrategy.INSTANCE;
}
strategyClass = classLoaderService.classForName( settingStr );
}
try {
return (MultiTableBulkIdStrategy) strategyClass.newInstance();

View File

@ -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";

View File

@ -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()