This method is database neutral and uses a sequence table that holds an incrementing sequence value. The
unique identifier value returned from the database is translated to a java type: java.lang.Long. This
strategy will work with any datastore. This method require a sequence table in the database and creates
one if doesn't exist.
Additional properties for configuring this generator are set in the JPA Meta-Data, see the
available properties below. Unsupported properties are silently ignored by DataNucleus.
|
Property
|
Description
|
Required
|
|
key-initial-value
|
First value to be allocated.
|
No. Defaults to 1
|
|
key-cache-size
|
number of unique identifiers to cache. The keys are pre-allocated, cached
and used on demand. If
key-cache-size
is greater than 1, it may generate holes in the
object keys in the database, if not all keys are used.
|
No. Default is 50
|
|
sequence-table-basis
|
Whether to define uniqueness on the base class name or the base table name.
Since there is no "base table name" when the root class has "subclass-table"
this should be set to "class" when the root class has "subclass-table" inheritance
|
No. Defaults to
class
, but the other option is
table
|
|
sequence-name
|
name for the sequence (overriding the "sequence-table-basis" above).
The row in the table will use this in the PK column
|
No
|
|
sequence-table-name
|
Table name for storing the sequence.
|
No. Defaults to
SEQUENCE_TABLE
|
|
sequence-catalog-name
|
Name of the catalog where the table is.
|
No.
|
|
sequence-schema-name
|
Name of the schema where the table is.
|
No.
|
|
sequence-name-column-name
|
Name for the column that represent sequence names.
|
No. Defaults to
SEQUENCE_NAME
|
|
sequence-nextval-column-name
|
Name for the column that represent incremeting sequence values.
|
No. Defaults to
NEXT_VAL
|
|
table-name
|
Name of the table whose column we are generating the value for (used when we have
no previous sequence value and want a start point.
|
No.
|
|
column-name
|
Name of the column we are generating the value for (used when we have
no previous sequence value and want a start point.
|
No.
|
This value generator will generate values unique across different JVMs