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 voidclearSaveWithIdContext()voidconfigure(org.hibernate.type.Type type, Properties params, org.hibernate.service.ServiceRegistry serviceRegistry)static voidenterSaveWithIdContext(Object object, Serializable id)Serializablegenerate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object obj)ResettableTableHiLoGeneratorgetResettableGenerator()voidinitialize(org.hibernate.boot.model.relational.SqlStringGenerationContext context)static voidleaveSaveWithIdContext()voidregisterExportables(org.hibernate.boot.model.relational.Database database)booleansupportsJdbcBatchInserts()
-
-
-
Method Detail
-
generate
public Serializable generate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object obj)
- Specified by:
generatein 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:
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
public ResettableTableHiLoGenerator getResettableGenerator()
-
-