Package org.hibernate.id
Class SequenceGenerator
- java.lang.Object
-
- org.hibernate.id.SequenceGenerator
-
- All Implemented Interfaces:
ExportableProducer,BulkInsertionCapableIdentifierGenerator,Configurable,IdentifierGenerator,PersistentIdentifierGenerator
- Direct Known Subclasses:
SequenceHiLoGenerator,SequenceIdentityGenerator
@Deprecated public class SequenceGenerator extends java.lang.Object implements PersistentIdentifierGenerator, BulkInsertionCapableIdentifierGenerator
Deprecated.UseSequenceStyleGeneratorinsteadsequence
Generates long values using an oracle-style sequence. A higher performance algorithm is SequenceHiLoGenerator.
Mapping parameters supported: sequence, parameters.- See Also:
SequenceHiLoGenerator
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPARAMETERSDeprecated.No longer supported.static java.lang.StringSEQUENCEDeprecated.The sequence parameter-
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
Constructors Constructor Description SequenceGenerator()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected IntegralDataTypeHolderbuildHolder()Deprecated.voidconfigure(Type type, java.util.Properties params, ServiceRegistry serviceRegistry)Deprecated.Configure this instance, given the value of parameters specified by the user as <param> elements.java.lang.StringdetermineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context)Deprecated.Return the select expression fragment, if any, that generates the identifier values.java.io.Serializablegenerate(SharedSessionContractImplementor session, java.lang.Object obj)Deprecated.Generate a new identifier.protected IntegralDataTypeHoldergenerateHolder(SharedSessionContractImplementor session)Deprecated.java.lang.ObjectgeneratorKey()Deprecated.java.lang.String[]getAllSqlForTests()Deprecated.Exposed for tests only.protected TypegetIdentifierType()Deprecated.QualifiedNamegetPhysicalSequenceName()Deprecated.java.lang.StringgetSequenceName()Deprecated.voidinitialize(SqlStringGenerationContext context)Deprecated.Initializes this instance, in particular pre-generates SQL as necessary.voidregisterExportables(Database database)Deprecated.Register database objects used by this identifier generator, e.g.booleansupportsBulkInsertionIdentifierGeneration()Deprecated.Given the configuration of this generator, is identifier generation as part of bulk insertion supported?-
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.BulkInsertionCapableIdentifierGenerator
determineBulkInsertionIdentifierGenerationSelectFragment
-
Methods inherited from interface org.hibernate.id.IdentifierGenerator
supportsJdbcBatchInserts
-
-
-
-
Field Detail
-
SEQUENCE
public static final java.lang.String SEQUENCE
Deprecated.The sequence parameter- See Also:
- Constant Field Values
-
PARAMETERS
@Deprecated public static final java.lang.String PARAMETERS
Deprecated.No longer supported. To specify initial-value or increment use the org.hibernate.id.enhanced.SequenceStyleGenerator generator instead.The parameters parameter, appended to the create sequence DDL. For example (Oracle): INCREMENT BY 1 START WITH 1 MAXVALUE 100 NOCACHE.- See Also:
- Constant Field Values
-
-
Method Detail
-
getIdentifierType
protected Type getIdentifierType()
Deprecated.
-
generatorKey
@Deprecated public java.lang.Object generatorKey()
Deprecated.Description copied from interface:PersistentIdentifierGeneratorReturn a key unique to the underlying database objects. Prevents us from trying to create/remove them multiple times.- Specified by:
generatorKeyin interfacePersistentIdentifierGenerator- Returns:
- Object an identifying key for this generator
-
getSequenceName
@Deprecated public java.lang.String getSequenceName()
Deprecated.
-
getPhysicalSequenceName
public QualifiedName getPhysicalSequenceName()
Deprecated.
-
getAllSqlForTests
@Deprecated public java.lang.String[] getAllSqlForTests()
Deprecated.Exposed for tests only.
-
configure
public void configure(Type type, java.util.Properties params, ServiceRegistry serviceRegistry) throws MappingException
Deprecated.Description copied from interface:IdentifierGeneratorConfigure this instance, given the value of parameters specified by the user as <param> elements.This method is called just once, following instantiation, and before
IdentifierGenerator.registerExportables(Database).- Specified by:
configurein interfaceConfigurable- Specified by:
configurein interfaceIdentifierGenerator- Parameters:
type- The id property type descriptorparams- param values, keyed by parameter nameserviceRegistry- Access to service that may be needed.- Throws:
MappingException- If configuration fails.
-
generate
public java.io.Serializable generate(SharedSessionContractImplementor session, java.lang.Object obj)
Deprecated.Description copied from interface:IdentifierGeneratorGenerate a new identifier.- Specified by:
generatein interfaceIdentifierGenerator- Parameters:
session- The session from which the request originatesobj- the entity or collection (idbag) for which the id is being generated- Returns:
- a new identifier
-
generateHolder
protected IntegralDataTypeHolder generateHolder(SharedSessionContractImplementor session)
Deprecated.
-
buildHolder
protected IntegralDataTypeHolder buildHolder()
Deprecated.
-
supportsBulkInsertionIdentifierGeneration
public boolean supportsBulkInsertionIdentifierGeneration()
Deprecated.Description copied from interface:BulkInsertionCapableIdentifierGeneratorGiven the configuration of this generator, is identifier generation as part of bulk insertion supported? IMPL NOTE : Mainly here to allow stuff like SequenceStyleGenerator which *can* support this based on configuration- Specified by:
supportsBulkInsertionIdentifierGenerationin interfaceBulkInsertionCapableIdentifierGenerator- Returns:
trueif bulk insertions are supported;falseotherwise.
-
determineBulkInsertionIdentifierGenerationSelectFragment
public java.lang.String determineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context)
Deprecated.Description copied from interface:BulkInsertionCapableIdentifierGeneratorReturn the select expression fragment, if any, that generates the identifier values.- Specified by:
determineBulkInsertionIdentifierGenerationSelectFragmentin interfaceBulkInsertionCapableIdentifierGenerator- Parameters:
context- A context for SQL string generation.- Returns:
- The identifier value generation fragment (SQL).
nullindicates that no fragment is needed.
-
registerExportables
public void registerExportables(Database database)
Deprecated.Description copied from interface:IdentifierGeneratorRegister database objects used by this identifier generator, e.g. sequences, tables, etc.This method is called just once, after
IdentifierGenerator.configure(Type, Properties, ServiceRegistry).- Specified by:
registerExportablesin interfaceExportableProducer- Specified by:
registerExportablesin interfaceIdentifierGenerator- Parameters:
database- The database instance
-
initialize
public void initialize(SqlStringGenerationContext context)
Deprecated.Description copied from interface:IdentifierGeneratorInitializes this instance, in particular pre-generates SQL as necessary.This method is called after
IdentifierGenerator.registerExportables(Database), before first use.- Specified by:
initializein interfaceIdentifierGenerator- Parameters:
context- A context to help generate SQL strings
-
-