Package org.hibernate.id
Class SequenceHiLoGenerator
java.lang.Object
org.hibernate.id.SequenceGenerator
org.hibernate.id.SequenceHiLoGenerator
- All Implemented Interfaces:
Configurable,IdentifierGenerator,PersistentIdentifierGenerator
seqhilo
An IdentifierGenerator that combines a hi/lo algorithm with an underlying oracle-style sequence that generates hi values. The user may specify a maximum lo value to determine how often new hi values are fetched.
If sequences are not available, TableHiLoGenerator might be an alternative.
Mapping parameters supported: sequence, max_lo, parameters.
An IdentifierGenerator that combines a hi/lo algorithm with an underlying oracle-style sequence that generates hi values. The user may specify a maximum lo value to determine how often new hi values are fetched.
If sequences are not available, TableHiLoGenerator might be an alternative.
Mapping parameters supported: sequence, max_lo, parameters.
- See Also:
-
Field Summary
FieldsFields 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 d) Configure this instance, given the value of parameters specified by the user as <param> elements.generate(SessionImplementor session, Object obj) Generate a new identifier.Methods inherited from class org.hibernate.id.SequenceGenerator
buildHolder, generateHolder, generatorKey, getIdentifierType, getSequenceName, sqlCreateStrings, sqlDropStrings
-
Field Details
-
MAX_LO
- See Also:
-
-
Constructor Details
-
SequenceHiLoGenerator
public SequenceHiLoGenerator()
-
-
Method Details
-
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
-
generate
Description copied from interface:IdentifierGeneratorGenerate a new identifier.- Specified by:
generatein interfaceIdentifierGenerator- Overrides:
generatein classSequenceGenerator- Parameters:
session-obj- the entity or toplevel collection for which the id is being generated- Returns:
- a new identifier
-