SequenceStyleGenerator
instead@Deprecated public class SequenceGenerator extends Object implements PersistentIdentifierGenerator, BulkInsertionCapableIdentifierGenerator, Configurable
<b>sequence</b><br> <br> Generates <tt>long</tt> values using an oracle-style sequence. A higher performance algorithm is <tt>SequenceHiLoGenerator</tt>.<br> <br> Mapping parameters supported: sequence, parameters.
SequenceHiLoGenerator
Modifier and Type | Field and Description |
---|---|
static String |
PARAMETERS
Deprecated.
No longer supported. To specify initial-value or increment use the
org.hibernate.id.enhanced.SequenceStyleGenerator generator instead.
|
static String |
SEQUENCE
Deprecated.
The sequence parameter
|
CATALOG, IDENTIFIER_NORMALIZER, PK, SCHEMA, TABLE, TABLES
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
Constructor and Description |
---|
SequenceGenerator()
Deprecated.
|
Modifier and Type | Method and 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 <tt><param></tt> elements.
|
String |
determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect)
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.
Return a key unique to the underlying database objects.
|
protected Type |
getIdentifierType()
Deprecated.
|
String |
getSequenceName()
Deprecated.
|
void |
registerExportables(Database database)
Deprecated.
Register the contained exportable things to the
Database |
String[] |
sqlCreateStrings(Dialect dialect)
Deprecated.
The SQL required to create the underlying database objects.
|
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?
<p/>
IMPL NOTE : Mainly here to allow stuff like SequenceStyleGenerator which can support this based on
configuration
|
public static final String SEQUENCE
The sequence parameter
@Deprecated public static final String PARAMETERS
The parameters parameter, appended to the create sequence DDL. For example (Oracle): <tt>INCREMENT BY 1 START WITH 1 MAXVALUE 100 NOCACHE</tt>.
protected Type getIdentifierType()
public Object generatorKey()
PersistentIdentifierGenerator
Return a key unique to the underlying database objects. Prevents us from trying to create/remove them multiple times.
generatorKey
in interface PersistentIdentifierGenerator
public String getSequenceName()
public void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException
Configurable
Configure this instance, given the value of parameters specified by the user as <tt><param></tt> elements. This method is called just once, following instantiation.
configure
in interface Configurable
type
- The id property type descriptorparams
- param values, keyed by parameter nameserviceRegistry
- Access to service that may be needed.MappingException
public Serializable generate(SharedSessionContractImplementor session, Object obj)
IdentifierGenerator
Generate a new identifier.
generate
in interface IdentifierGenerator
session
- The session from which the request originatesobj
- the entity or collection (idbag) for which the id is being generatedprotected IntegralDataTypeHolder generateHolder(SharedSessionContractImplementor session)
protected IntegralDataTypeHolder buildHolder()
public String[] sqlCreateStrings(Dialect dialect) throws HibernateException
PersistentIdentifierGenerator
The SQL required to create the underlying database objects.
sqlCreateStrings
in interface PersistentIdentifierGenerator
dialect
- The dialect against which to generate the create command(s)HibernateException
- problem creating the create command(s)public String[] sqlDropStrings(Dialect dialect) throws HibernateException
PersistentIdentifierGenerator
The SQL required to remove the underlying database objects.
sqlDropStrings
in interface PersistentIdentifierGenerator
dialect
- The dialect against which to generate the drop command(s)HibernateException
- problem creating the drop command(s)public boolean supportsBulkInsertionIdentifierGeneration()
BulkInsertionCapableIdentifierGenerator
Given the configuration of this generator, is identifier generation as part of bulk insertion supported? <p/> IMPL NOTE : Mainly here to allow stuff like SequenceStyleGenerator which can support this based on configuration
supportsBulkInsertionIdentifierGeneration
in interface BulkInsertionCapableIdentifierGenerator
true
if bulk insertions are supported; false
otherwise.public String determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect)
BulkInsertionCapableIdentifierGenerator
Return the select expression fragment, if any, that generates the identifier values.
determineBulkInsertionIdentifierGenerationSelectFragment
in interface BulkInsertionCapableIdentifierGenerator
dialect
- The dialect against which the insert will be performed.null
indicates that no fragment is needed.public void registerExportables(Database database)
ExportableProducer
Register the contained exportable things to the Database
registerExportables
in interface ExportableProducer
database
- The database instanceCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.