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_NAME
Fields inherited from interface org.hibernate.id.PersistentIdentifierGenerator
CATALOG, IDENTIFIER_NORMALIZER, PK, SCHEMA, TABLE, TABLES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
configure
(org.hibernate.type.Type type, Properties params, org.hibernate.service.ServiceRegistry serviceRegistry) static void
enterSaveWithIdContext
(Object object, Serializable id) void
initialize
(org.hibernate.boot.model.relational.SqlStringGenerationContext context) static void
void
registerExportables
(org.hibernate.boot.model.relational.Database database) boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
configure
in interfaceorg.hibernate.id.Configurable
- Specified by:
configure
in interfaceorg.hibernate.id.IdentifierGenerator
- Throws:
org.hibernate.MappingException
-
registerExportables
public void registerExportables(org.hibernate.boot.model.relational.Database database) - Specified by:
registerExportables
in interfaceorg.hibernate.boot.model.relational.ExportableProducer
- Specified by:
registerExportables
in interfaceorg.hibernate.id.IdentifierGenerator
-
initialize
public void initialize(org.hibernate.boot.model.relational.SqlStringGenerationContext context) - Specified by:
initialize
in interfaceorg.hibernate.id.IdentifierGenerator
-
supportsJdbcBatchInserts
public boolean supportsJdbcBatchInserts()- Specified by:
supportsJdbcBatchInserts
in interfaceorg.hibernate.id.IdentifierGenerator
-
getResettableGenerator