org.hibernate.id
Class MultipleHiLoPerTableGenerator
- Configurable, IdentifierGenerator, PersistentIdentifierGenerator
public class MultipleHiLoPerTableGenerator
A hilo
IdentifierGenerator that returns a
Long, constructed using
a hi/lo algorithm. The hi value MUST be fetched in a seperate transaction
to the
Session transaction so the generator must be able to obtain
a new connection and commit it. Hence this implementation may not
be used when the user is supplying connections. In this
case a
SequenceHiLoGenerator would be a better choice (where
supported).
A hilo
IdentifierGenerator that uses a database
table to store the last generated values. A table can contains
several hi values. They are distinct from each other through a key
This implementation is not compliant with a user connection
Allowed parameters (all of them are optional):
- table: table name (default hibernate_sequences)
- primary_key_column: key column name (default sequence_name)
- value_column: hi value column name(default sequence_next_hi_value)
- primary_key_value: key value for the current entity (default to the entity's primary table name)
- primary_key_length: length of the key column in DB represented as a varchar (default to 255)
- max_lo: max low value before increasing hi (default to Short.MAX_VALUE)
DEFAULT_TABLE
public static final String DEFAULT_TABLE
ID_TABLE
public static final String ID_TABLE
MAX_LO
public static final String MAX_LO
PK_COLUMN_NAME
public static final String PK_COLUMN_NAME
PK_LENGTH_NAME
public static final String PK_LENGTH_NAME
PK_VALUE_NAME
public static final String PK_VALUE_NAME
VALUE_COLUMN_NAME
public static final String VALUE_COLUMN_NAME
configure
public void configure(Type type,
Properties params,
Dialect dialect)
throws MappingException
Configure this instance, given the value of parameters
specified by the user as <param> elements.
This method is called just once, following instantiation.
- configure in interface Configurable
params
- param values, keyed by parameter name