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, Configurable
Deprecated.UseSequenceStyleGenerator
insteadsequence
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.String
PARAMETERS
Deprecated.No longer supported.static java.lang.String
SEQUENCE
Deprecated.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 IntegralDataTypeHolder
buildHolder()
Deprecated.void
configure(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.String
determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect)
Deprecated.Return the select expression fragment, if any, that generates the identifier values.java.io.Serializable
generate(SharedSessionContractImplementor session, java.lang.Object obj)
Deprecated.Generate a new identifier.protected IntegralDataTypeHolder
generateHolder(SharedSessionContractImplementor session)
Deprecated.java.lang.Object
generatorKey()
Deprecated.Return a key unique to the underlying database objects.protected Type
getIdentifierType()
Deprecated.java.lang.String
getSequenceName()
Deprecated.void
registerExportables(Database database)
Deprecated.Register the contained exportable things to theDatabase
java.lang.String[]
sqlCreateStrings(Dialect dialect)
Deprecated.The SQL required to create the underlying database objects.java.lang.String[]
sqlDropStrings(Dialect dialect)
Deprecated.The SQL required to remove the underlying database objects.boolean
supportsBulkInsertionIdentifierGeneration()
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.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
public java.lang.Object generatorKey()
Deprecated.Description copied from interface:PersistentIdentifierGenerator
Return a key unique to the underlying database objects. Prevents us from trying to create/remove them multiple times.- Specified by:
generatorKey
in interfacePersistentIdentifierGenerator
- Returns:
- Object an identifying key for this generator
-
getSequenceName
public java.lang.String getSequenceName()
Deprecated.
-
configure
public void configure(Type type, java.util.Properties params, ServiceRegistry serviceRegistry) throws MappingException
Deprecated.Description copied from interface:Configurable
Configure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.- Specified by:
configure
in interfaceConfigurable
- Parameters:
type
- The id property type descriptorparams
- param values, keyed by parameter nameserviceRegistry
- Access to service that may be needed.- Throws:
MappingException
-
generate
public java.io.Serializable generate(SharedSessionContractImplementor session, java.lang.Object obj)
Deprecated.Description copied from interface:IdentifierGenerator
Generate a new identifier.- Specified by:
generate
in 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.
-
sqlCreateStrings
public java.lang.String[] sqlCreateStrings(Dialect dialect) throws HibernateException
Deprecated.Description copied from interface:PersistentIdentifierGenerator
The SQL required to create the underlying database objects.- Specified by:
sqlCreateStrings
in interfacePersistentIdentifierGenerator
- Parameters:
dialect
- The dialect against which to generate the create command(s)- Returns:
- The create command(s)
- Throws:
HibernateException
- problem creating the create command(s)
-
sqlDropStrings
public java.lang.String[] sqlDropStrings(Dialect dialect) throws HibernateException
Deprecated.Description copied from interface:PersistentIdentifierGenerator
The SQL required to remove the underlying database objects.- Specified by:
sqlDropStrings
in interfacePersistentIdentifierGenerator
- Parameters:
dialect
- The dialect against which to generate the drop command(s)- Returns:
- The drop command(s)
- Throws:
HibernateException
- problem creating the drop command(s)
-
supportsBulkInsertionIdentifierGeneration
public boolean supportsBulkInsertionIdentifierGeneration()
Deprecated.Description copied from interface:BulkInsertionCapableIdentifierGenerator
Given 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:
supportsBulkInsertionIdentifierGeneration
in interfaceBulkInsertionCapableIdentifierGenerator
- Returns:
true
if bulk insertions are supported;false
otherwise.
-
determineBulkInsertionIdentifierGenerationSelectFragment
public java.lang.String determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect)
Deprecated.Description copied from interface:BulkInsertionCapableIdentifierGenerator
Return the select expression fragment, if any, that generates the identifier values.- Specified by:
determineBulkInsertionIdentifierGenerationSelectFragment
in interfaceBulkInsertionCapableIdentifierGenerator
- Parameters:
dialect
- The dialect against which the insert will be performed.- Returns:
- The identifier value generation fragment (SQL).
null
indicates that no fragment is needed.
-
registerExportables
public void registerExportables(Database database)
Deprecated.Description copied from interface:ExportableProducer
Register the contained exportable things to theDatabase
- Specified by:
registerExportables
in interfaceExportableProducer
- Parameters:
database
- The database instance
-
-