Known Direct Subclasses
|
Class Overview
sequence
Generates long values using an oracle-style sequence. A higher
performance algorithm is SequenceHiLoGenerator.
Mapping parameters supported: sequence, parameters.
Constants
public
static
final
String
PARAMETERS
The parameters parameter, appended to the create sequence DDL.
For example (Oracle): INCREMENT BY 1 START WITH 1 MAXVALUE 100 NOCACHE.
Constant Value:
"parameters"
public
static
final
String
SEQUENCE
Constant Value:
"sequence"
Public Constructors
public
SequenceGenerator
()
Public Methods
public
void
configure
(Type type, Properties params, Dialect dialect)
Configure this instance, given the value of parameters
specified by the user as <param> elements.
This method is called just once, following instantiation.
Parameters
params
| param values, keyed by parameter name
|
Generate a new identifier.
Parameters
obj
| the entity or toplevel collection for which the id is being generated |
public
Object
generatorKey
()
Return a key unique to the underlying database objects. Prevents us from
trying to create/remove them multiple times.
Returns
- Object an identifying key for this generator
public
String
getSequenceName
()
public
String[]
sqlCreateStrings
(Dialect dialect)
The SQL required to create the underlying database objects.
Parameters
dialect
| The dialect against which to generate the create command(s) |
public
String[]
sqlDropStrings
(Dialect dialect)
The SQL required to remove the underlying database objects.
Parameters
dialect
| The dialect against which to generate the drop command(s) |
Protected Methods
protected
Type
getIdentifierType
()