|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.id.TableGenerator
An IdentifierGenerator that uses a database
table to store the last generated value. It is not
intended that applications use this strategy directly.
However, it may be used to build other (efficient)
strategies. The returned type is Integer.
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 Hibernate is
fetching connections from an application server datasource
or when the user is supplying connections.
The returned value is of type integer.
Mapping parameters supported: table, column
TableHiLoGenerator| Field Summary | |
static String |
COLUMN
The column parameter |
static String |
TABLE
The table parameter |
| Fields inherited from interface net.sf.hibernate.id.PersistentIdentifierGenerator |
PK, SCHEMA |
| Constructor Summary | |
TableGenerator()
|
|
| Method Summary | |
void |
configure(Type type,
Properties params,
Dialect dialect)
Configure this instance, given the value of parameters specified by the user as <param> elements. |
Serializable |
generate(SessionImplementor session,
Object object)
Generate a new identifier. |
Object |
generatorKey()
Return a key unique to the underlying database objects. |
String[] |
sqlCreateStrings(Dialect dialect)
The SQL required to create the underlying database objects. |
String |
sqlDropString(Dialect dialect)
The SQL required to remove the underlying database objects. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String COLUMN
public static final String TABLE
| Constructor Detail |
public TableGenerator()
| Method Detail |
public void configure(Type type, Properties params, Dialect dialect)
Configurable
configure in interface Configurableparams - param values, keyed by parameter namepublic Serializable generate(SessionImplementor session, Object object) throws SQLException, HibernateException
IdentifierGenerator
generate in interface IdentifierGeneratorsession - object - the entity or toplevel collection for which the id is being generated
SQLException
HibernateExceptionpublic String[] sqlCreateStrings(Dialect dialect) throws HibernateException
PersistentIdentifierGenerator
sqlCreateStrings in interface PersistentIdentifierGeneratordialect -
HibernateExceptionpublic String sqlDropString(Dialect dialect)
PersistentIdentifierGenerator
sqlDropString in interface PersistentIdentifierGeneratordialect -
public Object generatorKey()
PersistentIdentifierGenerator
generatorKey in interface PersistentIdentifierGenerator
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||