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 Object implements PersistentIdentifierGenerator, BulkInsertionCapableIdentifierGenerator
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 String
PARAMETERS
Deprecated.No longer supported.static 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, Properties params, ServiceRegistry serviceRegistry)
Deprecated.Configure this instance, given the value of parameters specified by the user as <param> elements.String
determineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context)
Deprecated.Return the select expression fragment, if any, that generates the identifier values.Serializable
generate(SharedSessionContractImplementor session, Object obj)
Deprecated.Generate a new identifier.protected IntegralDataTypeHolder
generateHolder(SharedSessionContractImplementor session)
Deprecated.Object
generatorKey()
Deprecated.String[]
getAllSqlForTests()
Deprecated.Exposed for tests only.protected Type
getIdentifierType()
Deprecated.QualifiedName
getPhysicalSequenceName()
Deprecated.String
getSequenceName()
Deprecated.void
initialize(SqlStringGenerationContext context)
Deprecated.Initializes this instance, in particular pre-generates SQL as necessary.void
registerExportables(Database database)
Deprecated.Register database objects used by this identifier generator, e.g.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.BulkInsertionCapableIdentifierGenerator
determineBulkInsertionIdentifierGenerationSelectFragment
-
Methods inherited from interface org.hibernate.id.IdentifierGenerator
supportsJdbcBatchInserts
-
-
-
-
Field Detail
-
SEQUENCE
public static final String SEQUENCE
Deprecated.The sequence parameter- See Also:
- Constant Field Values
-
PARAMETERS
@Deprecated public static final 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 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
@Deprecated public String getSequenceName()
Deprecated.
-
getPhysicalSequenceName
public QualifiedName getPhysicalSequenceName()
Deprecated.
-
getAllSqlForTests
@Deprecated public String[] getAllSqlForTests()
Deprecated.Exposed for tests only.
-
configure
public void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException
Deprecated.Description copied from interface:IdentifierGenerator
Configure 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:
configure
in interfaceConfigurable
- Specified by:
configure
in 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 Serializable generate(SharedSessionContractImplementor session, 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.
-
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 String determineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context)
Deprecated.Description copied from interface:BulkInsertionCapableIdentifierGenerator
Return the select expression fragment, if any, that generates the identifier values.- Specified by:
determineBulkInsertionIdentifierGenerationSelectFragment
in interfaceBulkInsertionCapableIdentifierGenerator
- Parameters:
context
- A context for SQL string generation.- 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:IdentifierGenerator
Register 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:
registerExportables
in interfaceExportableProducer
- Specified by:
registerExportables
in interfaceIdentifierGenerator
- Parameters:
database
- The database instance
-
initialize
public void initialize(SqlStringGenerationContext context)
Deprecated.Description copied from interface:IdentifierGenerator
Initializes this instance, in particular pre-generates SQL as necessary.This method is called after
IdentifierGenerator.registerExportables(Database)
, before first use.- Specified by:
initialize
in interfaceIdentifierGenerator
- Parameters:
context
- A context to help generate SQL strings
-
-