Package com.atlassian.bamboo.persistence
Class ImportAwareGenerator
java.lang.Object
com.atlassian.bamboo.persistence.ImportAwareGenerator
- All Implemented Interfaces:
org.hibernate.boot.model.relational.ExportableProducer,org.hibernate.id.Configurable,org.hibernate.id.IdentifierGenerator,org.hibernate.id.PersistentIdentifierGenerator
public class ImportAwareGenerator
extends Object
implements org.hibernate.id.PersistentIdentifierGenerator, org.hibernate.id.Configurable
This class wraps a
ResettableTableHiLoGenerator. When used through
HibernateDaoUtils,
it will not generate a new id and will use a supplied one instead. Should only be used for import purposes.-
Field Summary
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAMEFields inherited from interface org.hibernate.id.PersistentIdentifierGenerator
CATALOG, IDENTIFIER_NORMALIZER, PK, SCHEMA, TABLE, TABLES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidconfigure(org.hibernate.type.Type type, Properties params, org.hibernate.service.ServiceRegistry serviceRegistry) static voidenterSaveWithIdContext(Object object, Serializable id) voidinitialize(org.hibernate.boot.model.relational.SqlStringGenerationContext context) static voidvoidregisterExportables(org.hibernate.boot.model.relational.Database database) booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.id.PersistentIdentifierGenerator
generatorKey
-
Constructor Details
-
ImportAwareGenerator
public ImportAwareGenerator()
-
-
Method Details
-
enterSaveWithIdContext
-
leaveSaveWithIdContext
public static void leaveSaveWithIdContext() -
clearSaveWithIdContext
@TestOnly public static void clearSaveWithIdContext() -
configure
public void configure(org.hibernate.type.Type type, Properties params, org.hibernate.service.ServiceRegistry serviceRegistry) throws org.hibernate.MappingException - Specified by:
configurein interfaceorg.hibernate.id.Configurable- Specified by:
configurein interfaceorg.hibernate.id.IdentifierGenerator- Throws:
org.hibernate.MappingException
-
registerExportables
public void registerExportables(org.hibernate.boot.model.relational.Database database) - Specified by:
registerExportablesin interfaceorg.hibernate.boot.model.relational.ExportableProducer- Specified by:
registerExportablesin interfaceorg.hibernate.id.IdentifierGenerator
-
initialize
public void initialize(org.hibernate.boot.model.relational.SqlStringGenerationContext context) - Specified by:
initializein interfaceorg.hibernate.id.IdentifierGenerator
-
supportsJdbcBatchInserts
public boolean supportsJdbcBatchInserts()- Specified by:
supportsJdbcBatchInsertsin interfaceorg.hibernate.id.IdentifierGenerator
-
getResettableGenerator