java.lang.Object | ||
↳ | org.hibernate.engine.TransactionHelper | |
↳ | org.hibernate.id.TableGenerator |
Known Direct Subclasses |
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
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
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | COLUMN | The column parameter | |||||||||
String | DEFAULT_COLUMN_NAME | Default column name | |||||||||
String | DEFAULT_TABLE_NAME | Default table name | |||||||||
String | TABLE | The table parameter |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.hibernate.id.IdentifierGenerator
| |||||||||||
From interface
org.hibernate.id.PersistentIdentifierGenerator
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.hibernate.id.PersistentIdentifierGenerator
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Configure this instance, given the value of parameters
specified by the user as <param> elements.
| |||||||||||
Get the next value.
| |||||||||||
Generate a new identifier.
| |||||||||||
Return a key unique to the underlying database objects.
| |||||||||||
The SQL required to create the underlying database objects.
| |||||||||||
The SQL required to remove the underlying database objects.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.hibernate.engine.TransactionHelper
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.hibernate.id.Configurable
| |||||||||||
From interface
org.hibernate.id.IdentifierGenerator
| |||||||||||
From interface
org.hibernate.id.PersistentIdentifierGenerator
|
Default table name
Configure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.
params | param values, keyed by parameter name |
---|
Get the next value.
conn | The sql connection to use. |
---|---|
sql | n/a |
Integer
. Since 3.5 it now
returns a IntegralDataTypeHolder
SQLException |
---|
Generate a new identifier.
object | the entity or toplevel collection for which the id is being generated |
---|
Return a key unique to the underlying database objects. Prevents us from trying to create/remove them multiple times.
The SQL required to create the underlying database objects.
dialect | The dialect against which to generate the create command(s) |
---|
HibernateException |
---|
The SQL required to remove the underlying database objects.
dialect | The dialect against which to generate the drop command(s) |
---|