org.hibernate.id
Class SequenceHiLoGenerator
java.lang.Object
org.hibernate.id.SequenceGenerator
org.hibernate.id.SequenceHiLoGenerator
- All Implemented Interfaces:
- BulkInsertionCapableIdentifierGenerator, Configurable, IdentifierGenerator, PersistentIdentifierGenerator
public class SequenceHiLoGenerator
- extends SequenceGenerator
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.
- See Also:
TableHiLoGenerator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_LO
public static final String MAX_LO
- See Also:
- Constant Field Values
SequenceHiLoGenerator
public SequenceHiLoGenerator()
configure
public void configure(Type type,
Properties params,
Dialect d)
throws MappingException
- Description copied from interface:
Configurable
- Configure this instance, given the value of parameters
specified by the user as <param> elements.
This method is called just once, following instantiation.
- Specified by:
configure
in interface Configurable
- Overrides:
configure
in class SequenceGenerator
params
- param values, keyed by parameter name
- Throws:
MappingException
generate
public Serializable generate(SessionImplementor session,
Object obj)
- Description copied from interface:
IdentifierGenerator
- Generate a new identifier.
- Specified by:
generate
in interface IdentifierGenerator
- Overrides:
generate
in class SequenceGenerator
obj
- the entity or toplevel collection for which the id is being generated
- Returns:
- a new identifier
Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.