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.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(Dialect dialect)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.Return a key unique to the underlying database objects.protected TypegetIdentifierType()Deprecated.java.lang.StringgetSequenceName()Deprecated.voidregisterExportables(Database database)Deprecated.Register the contained exportable things to theDatabasejava.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.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.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: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
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:ConfigurableConfigure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.- Specified by:
configurein 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: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.
-
sqlCreateStrings
public java.lang.String[] sqlCreateStrings(Dialect dialect) throws HibernateException
Deprecated.Description copied from interface:PersistentIdentifierGeneratorThe SQL required to create the underlying database objects.- Specified by:
sqlCreateStringsin 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:PersistentIdentifierGeneratorThe SQL required to remove the underlying database objects.- Specified by:
sqlDropStringsin 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: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(Dialect dialect)
Deprecated.Description copied from interface:BulkInsertionCapableIdentifierGeneratorReturn the select expression fragment, if any, that generates the identifier values.- Specified by:
determineBulkInsertionIdentifierGenerationSelectFragmentin interfaceBulkInsertionCapableIdentifierGenerator- Parameters:
dialect- The dialect against which the insert will be performed.- Returns:
- The identifier value generation fragment (SQL).
nullindicates that no fragment is needed.
-
registerExportables
public void registerExportables(Database database)
Deprecated.Description copied from interface:ExportableProducerRegister the contained exportable things to theDatabase- Specified by:
registerExportablesin interfaceExportableProducer- Parameters:
database- The database instance
-
-