|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.engine.TransactionHelper
org.hibernate.id.MultipleHiLoPerTableGenerator
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):
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_TABLE
|
static java.lang.String |
ID_TABLE
|
static java.lang.String |
MAX_LO
|
static java.lang.String |
PK_COLUMN_NAME
|
static java.lang.String |
PK_LENGTH_NAME
|
static java.lang.String |
PK_VALUE_NAME
|
static java.lang.String |
VALUE_COLUMN_NAME
|
Fields inherited from interface org.hibernate.id.PersistentIdentifierGenerator |
---|
CATALOG, PK, SCHEMA, SQL_STATEMENT_LOGGER, TABLE, TABLES |
Fields inherited from interface org.hibernate.id.IdentifierGenerator |
---|
ENTITY_NAME |
Constructor Summary | |
---|---|
MultipleHiLoPerTableGenerator()
|
Method Summary | |
---|---|
void |
configure(Type type,
java.util.Properties params,
Dialect dialect)
Configure this instance, given the value of parameters specified by the user as <param> elements. |
java.io.Serializable |
doWorkInCurrentTransaction(java.sql.Connection conn,
java.lang.String sql)
The work to be done |
java.io.Serializable |
generate(SessionImplementor session,
java.lang.Object obj)
Generate a new identifier. |
java.lang.Object |
generatorKey()
Return a key unique to the underlying database objects. |
java.lang.String[] |
sqlCreateStrings(Dialect dialect)
The SQL required to create the underlying database objects. |
java.lang.String[] |
sqlDropStrings(Dialect dialect)
The SQL required to remove the underlying database objects. |
Methods inherited from class org.hibernate.engine.TransactionHelper |
---|
doWorkInNewTransaction |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ID_TABLE
public static final java.lang.String PK_COLUMN_NAME
public static final java.lang.String PK_VALUE_NAME
public static final java.lang.String VALUE_COLUMN_NAME
public static final java.lang.String PK_LENGTH_NAME
public static final java.lang.String DEFAULT_TABLE
public static final java.lang.String MAX_LO
Constructor Detail |
---|
public MultipleHiLoPerTableGenerator()
Method Detail |
---|
public java.lang.String[] sqlCreateStrings(Dialect dialect) throws HibernateException
PersistentIdentifierGenerator
sqlCreateStrings
in interface PersistentIdentifierGenerator
dialect
- The dialect against which to generate the create command(s)
HibernateException
- problem creating the create command(s)public java.lang.String[] sqlDropStrings(Dialect dialect) throws HibernateException
PersistentIdentifierGenerator
sqlDropStrings
in interface PersistentIdentifierGenerator
dialect
- The dialect against which to generate the drop command(s)
HibernateException
- problem creating the drop command(s)public java.lang.Object generatorKey()
PersistentIdentifierGenerator
generatorKey
in interface PersistentIdentifierGenerator
public java.io.Serializable doWorkInCurrentTransaction(java.sql.Connection conn, java.lang.String sql) throws java.sql.SQLException
TransactionHelper
doWorkInCurrentTransaction
in class TransactionHelper
java.sql.SQLException
public java.io.Serializable generate(SessionImplementor session, java.lang.Object obj) throws HibernateException
IdentifierGenerator
generate
in interface IdentifierGenerator
obj
- the entity or toplevel collection for which the id is being generated
HibernateException
public void configure(Type type, java.util.Properties params, Dialect dialect) throws MappingException
Configurable
configure
in interface Configurable
params
- param values, keyed by parameter name
MappingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |