Package org.hibernate.id
Class SequenceIdentityGenerator
java.lang.Object
org.hibernate.id.SequenceGenerator
org.hibernate.id.SequenceIdentityGenerator
- All Implemented Interfaces:
Configurable,IdentifierGenerator,PersistentIdentifierGenerator,PostInsertIdentifierGenerator
public class SequenceIdentityGenerator
extends SequenceGenerator
implements PostInsertIdentifierGenerator
A generator which combines sequence generation with immediate retrieval
through JDBC3
getGeneratedKeys.
In this respect it works much like ANSI-SQL IDENTITY generation.
This generator only known to work with newer Oracle drivers compiled for
JDK 1.4 (JDBC3).
Note: Due to a bug in Oracle drivers, sql comments on these insert statements
are completely disabled.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields inherited from class org.hibernate.id.SequenceGenerator
PARAMETERS, SEQUENCEFields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAMEFields inherited from interface org.hibernate.id.PersistentIdentifierGenerator
CATALOG, IDENTIFIER_NORMALIZER, PK, SCHEMA, SQL_STATEMENT_LOGGER, TABLE, TABLES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Type type, Properties params, Dialect dialect) Configure this instance, given the value of parameters specified by the user as <param> elements.generate(SessionImplementor s, Object obj) Generate a new identifier.getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister, Dialect dialect, boolean isGetGeneratedKeysEnabled) Methods inherited from class org.hibernate.id.SequenceGenerator
buildHolder, generateHolder, generatorKey, getIdentifierType, getSequenceName, sqlCreateStrings, sqlDropStrings
-
Constructor Details
-
SequenceIdentityGenerator
public SequenceIdentityGenerator()
-
-
Method Details
-
generate
Description copied from interface:IdentifierGeneratorGenerate a new identifier.- Specified by:
generatein interfaceIdentifierGenerator- Overrides:
generatein classSequenceGenerator- Parameters:
s-obj- the entity or toplevel collection for which the id is being generated- Returns:
- a new identifier
-
getInsertGeneratedIdentifierDelegate
public InsertGeneratedIdentifierDelegate getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister, Dialect dialect, boolean isGetGeneratedKeysEnabled) throws HibernateException - Specified by:
getInsertGeneratedIdentifierDelegatein interfacePostInsertIdentifierGenerator- Throws:
HibernateException
-
configure
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- Overrides:
configurein classSequenceGenerator- Parameters:
params- param values, keyed by parameter name- Throws:
MappingException
-