站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

SequenceHiLoGenerator (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.id
Class SequenceHiLoGenerator

java.lang.Object
  extended bynet.sf.hibernate.id.SequenceGenerator
      extended bynet.sf.hibernate.id.SequenceHiLoGenerator
All Implemented Interfaces:
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.

Author:
Gavin King
See Also:
TableHiLoGenerator

Field Summary
static String MAX_LO
           
 
Fields inherited from class net.sf.hibernate.id.SequenceGenerator
PARAMETERS, SEQUENCE
 
Fields inherited from interface net.sf.hibernate.id.PersistentIdentifierGenerator
PK, SCHEMA, TABLE
 
Constructor Summary
SequenceHiLoGenerator()
           
 
Method Summary
 void configure(Type type, Properties params, Dialect d)
          Configure this instance, given the value of parameters specified by the user as <param> elements.
 Serializable generate(SessionImplementor session, Object obj)
          Generate a new identifier.
 
Methods inherited from class net.sf.hibernate.id.SequenceGenerator
generatorKey, sqlCreateStrings, sqlDropString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LO

public static final String MAX_LO
See Also:
Constant Field Values
Constructor Detail

SequenceHiLoGenerator

public SequenceHiLoGenerator()
Method Detail

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
Throws:
MappingException

generate

public Serializable generate(SessionImplementor session,
                             Object obj)
                      throws SQLException,
                             HibernateException
Description copied from interface: IdentifierGenerator
Generate a new identifier.

Specified by:
generate in interface IdentifierGenerator
Overrides:
generate in class SequenceGenerator
Throws:
SQLException
HibernateException