Class TableGenerator

All Implemented Interfaces:
Configurable, IdentifierGenerator, PersistentIdentifierGenerator
Direct Known Subclasses:
TableHiLoGenerator

public class TableGenerator extends TransactionHelper implements PersistentIdentifierGenerator, Configurable
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 any supported by IntegralDataTypeHolder

The value MUST be fetched in a separate transaction from that of the main session transaction so the generator must be able to obtain a new connection and commit it. Hence this implementation may only be used when Hibernate is fetching connections, not when the user is supplying connections.

Again, the return types supported here are any of the ones supported by IntegralDataTypeHolder. This is new as of 3.5. Prior to that this generator only returned Integer values.

Mapping parameters supported: table, column

See Also: