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 aResettableTableHiLoGenerator
. When used throughHibernateDaoUtils
, it will not generate a new id and will use a supplied one instead. Should only be used for import purposes.
-
-
Constructor Summary
Constructors Constructor Description ImportAwareGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clearSaveWithIdContext()
void
configure(org.hibernate.type.Type type, Properties params, org.hibernate.service.ServiceRegistry serviceRegistry)
static void
enterSaveWithIdContext(Object object, Serializable id)
Serializable
generate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object obj)
ResettableTableHiLoGenerator
getResettableGenerator()
void
initialize(org.hibernate.boot.model.relational.SqlStringGenerationContext context)
static void
leaveSaveWithIdContext()
void
registerExportables(org.hibernate.boot.model.relational.Database database)
boolean
supportsJdbcBatchInserts()
-
-
-
Method Detail
-
generate
public Serializable generate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object obj)
- Specified by:
generate
in interfaceorg.hibernate.id.IdentifierGenerator
-
enterSaveWithIdContext
public static void enterSaveWithIdContext(Object object, Serializable id)
-
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
public ResettableTableHiLoGenerator getResettableGenerator()
-
-