Top Description Fields Constructors Methods
org.hibernate.id

public Class SequenceHiLoGenerator

extends SequenceGenerator
Class Inheritance
Imports
java.io.Serializable, java.util.Properties, org.hibernate.MappingException, org.hibernate.dialect.Dialect, org.hibernate.engine.SessionImplementor, org.hibernate.id.enhanced.AccessCallback, .OptimizerFactory, org.hibernate.type.Type, org.hibernate.util.PropertiesHelper

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.
Author
Gavin King
See Also
TableHiLoGenerator

Field Summary

Modifier and TypeField and Description
private OptimizerFactory.LegacyHiLoAlgorithmOptimizer
public static final String
private int
Inherited from org.hibernate.id.SequenceGenerator:
PARAMETERSSEQUENCE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
configure(Type type, Properties
param values, keyed by parameter name
params
,
Dialect d)

Overrides org.hibernate.id.SequenceGenerator.configure.

Implements org.hibernate.id.Configurable.configure.

Configure this instance, given the value of parameters specified by the user as <param> elements.
public synchronized Serializable
generate(final SessionImplementor session, Object
the entity or toplevel collection for which the id is being generated
obj
)

Overrides org.hibernate.id.SequenceGenerator.generate.

Implements org.hibernate.id.IdentifierGenerator.generate.

Generate a new identifier.
pack-priv OptimizerFactory.LegacyHiLoAlgorithmOptimizer

Returns:

The optimizer
getHiloOptimizer
()

For testing/assertion purposes

Inherited from org.hibernate.id.SequenceGenerator:
buildHoldergenerateHoldergeneratorKeygetIdentifierTypegetSequenceNamesqlCreateStringssqlDropStrings

Field Detail

hiloOptimizerback to summary
private OptimizerFactory.LegacyHiLoAlgorithmOptimizer hiloOptimizer
MAX_LOback to summary
public static final String MAX_LO
maxLoback to summary
private int maxLo

Constructor Detail

SequenceHiLoGeneratorback to summary
public SequenceHiLoGenerator()

Method Detail

configureback to summary
public void configure(Type type, Properties params, Dialect d) throws MappingException

Overrides org.hibernate.id.SequenceGenerator.configure.

Implements org.hibernate.id.Configurable.configure.

Doc from org.hibernate.id.Configurable.configure.

Configure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.

Parameters
params:Properties

param values, keyed by parameter name

generateback to summary
public synchronized Serializable generate(final SessionImplementor session, Object obj)

Overrides org.hibernate.id.SequenceGenerator.generate.

Implements org.hibernate.id.IdentifierGenerator.generate.

Doc from org.hibernate.id.IdentifierGenerator.generate.

Generate a new identifier.

Parameters
obj:Object

the entity or toplevel collection for which the id is being generated

Returns:Serializable

a new identifier

getHiloOptimizerback to summary
pack-priv OptimizerFactory.LegacyHiLoAlgorithmOptimizer getHiloOptimizer()

For testing/assertion purposes

Returns:OptimizerFactory.LegacyHiLoAlgorithmOptimizer

The optimizer