org.jboss.ejb3.entity
Class JTATableIdGenerator

java.lang.Object
  extended by org.jboss.ejb3.entity.JTATableIdGenerator
All Implemented Interfaces:
org.hibernate.id.Configurable, org.hibernate.id.IdentifierGenerator, org.hibernate.id.PersistentIdentifierGenerator

public class JTATableIdGenerator
extends Object
implements org.hibernate.id.PersistentIdentifierGenerator, org.hibernate.id.Configurable

A hilo IdentifierGenerator that uses a database table to store the last generated value.

This implementation is solely for use inside JBoss using JTA for transactions.

TODO implement sequence allocation

Version:
$Revision: 61136 $
Author:
Klaus Richarz.
See Also:
TableGenerator, TableGenerator

Field Summary
static String ALLOCATION_SIZE
          The allocation-size parameter
static String COLUMN
          The column parameter
static int DEFAULT_ALLOCATION_SIZE
          Default allocation-size
static String DEFAULT_COLUMN_NAME
          Default column name
static String DEFAULT_TABLE_NAME
          Default table name
static String TABLE
          The table parameter
 
Fields inherited from interface org.hibernate.id.PersistentIdentifierGenerator
CATALOG, PK, SCHEMA, SQL, TABLES
 
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME
 
Constructor Summary
JTATableIdGenerator()
           
 
Method Summary
 void configure(org.hibernate.type.Type type, Properties params, org.hibernate.dialect.Dialect dialect)
           
 Serializable generate(org.hibernate.engine.SessionImplementor session, Object object)
           
 Object generatorKey()
           
 String[] sqlCreateStrings(org.hibernate.dialect.Dialect dialect)
           
 String[] sqlDropStrings(org.hibernate.dialect.Dialect dialect)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN

public static final String COLUMN
The column parameter

See Also:
Constant Field Values

DEFAULT_COLUMN_NAME

public static final String DEFAULT_COLUMN_NAME
Default column name

See Also:
Constant Field Values

TABLE

public static final String TABLE
The table parameter

See Also:
Constant Field Values

DEFAULT_TABLE_NAME

public static final String DEFAULT_TABLE_NAME
Default table name

See Also:
Constant Field Values

ALLOCATION_SIZE

public static final String ALLOCATION_SIZE
The allocation-size parameter

See Also:
Constant Field Values

DEFAULT_ALLOCATION_SIZE

public static final int DEFAULT_ALLOCATION_SIZE
Default allocation-size

See Also:
Constant Field Values
Constructor Detail

JTATableIdGenerator

public JTATableIdGenerator()
Method Detail

configure

public void configure(org.hibernate.type.Type type,
                      Properties params,
                      org.hibernate.dialect.Dialect dialect)
Specified by:
configure in interface org.hibernate.id.Configurable

generate

public Serializable generate(org.hibernate.engine.SessionImplementor session,
                             Object object)
                      throws org.hibernate.HibernateException
Specified by:
generate in interface org.hibernate.id.IdentifierGenerator
Throws:
org.hibernate.HibernateException

sqlCreateStrings

public String[] sqlCreateStrings(org.hibernate.dialect.Dialect dialect)
                          throws org.hibernate.HibernateException
Specified by:
sqlCreateStrings in interface org.hibernate.id.PersistentIdentifierGenerator
Throws:
org.hibernate.HibernateException

sqlDropStrings

public String[] sqlDropStrings(org.hibernate.dialect.Dialect dialect)
Specified by:
sqlDropStrings in interface org.hibernate.id.PersistentIdentifierGenerator

generatorKey

public Object generatorKey()
Specified by:
generatorKey in interface org.hibernate.id.PersistentIdentifierGenerator


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.