|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.valuegenerator.AbstractGenerator
org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator
org.datanucleus.store.rdbms.valuegenerator.AbstractRDBMSGenerator
org.datanucleus.store.rdbms.valuegenerator.TableGenerator
public final class TableGenerator
Identity generator for RDBMS databases that generates ids using a table in the database. This generator is coupled to core and can't be used in standalone mode.
The following properties define the name of the sequence being generated. If "sequence-name" is specified then it is used. Otherwise the name of the sequence will either be based on the table name or the class name (for what we are generating the ids).
The following properties define the table where the identities are generated.
The following properties control the initial value, and the number of ids that are cached (generated) in each call.
The following properties are used when finding the starting point for the identities generated.
| Field Summary | |
|---|---|
static String |
DEFAULT_NEXTVALUE_COLUMN_NAME
Default name for the column storing the next value of the sequence. |
static String |
DEFAULT_SEQUENCE_COLUMN_NAME
Default name for the column storing the name of the sequence. |
static String |
DEFAULT_TABLE_NAME
Default name for the datastore table storing the sequence values. |
| Fields inherited from class org.datanucleus.store.rdbms.valuegenerator.AbstractRDBMSGenerator |
|---|
connection, LOCALISER_RDBMS |
| Fields inherited from class org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator |
|---|
connectionProvider, storeMgr |
| Fields inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator |
|---|
allocationSize, block, initialValue, LOCALISER, name, properties, repositoryExists |
| Constructor Summary | |
|---|---|
TableGenerator(String name,
Properties props)
Constructor. |
|
| Method Summary | |
|---|---|
protected boolean |
createRepository()
Method to create the repository for ids to be stored. |
SequenceTable |
getTable()
Convenience accessor for the table being used. |
protected void |
initialiseSequenceTable()
Method to initialise the sequence table used for storing the sequence values. |
protected boolean |
repositoryExists()
Method to return if the repository already exists. |
protected boolean |
requiresRepository()
Indicator for whether the generator requires its own repository. |
org.datanucleus.store.valuegenerator.ValueGenerationBlock |
reserveBlock(long size)
Method to reserve a block of "size" identities. |
| Methods inherited from class org.datanucleus.store.rdbms.valuegenerator.AbstractRDBMSGenerator |
|---|
obtainGenerationBlock, requiresConnection |
| Methods inherited from class org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator |
|---|
setConnectionProvider, setStoreManager |
| Methods inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator |
|---|
allocate, current, currentValue, getName, getStorageClass, next, nextValue, obtainGenerationBlock, reserveBlock |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_TABLE_NAME
public static final String DEFAULT_SEQUENCE_COLUMN_NAME
public static final String DEFAULT_NEXTVALUE_COLUMN_NAME
| Constructor Detail |
|---|
public TableGenerator(String name,
Properties props)
name - Symbolic name for this generatorprops - Properties defining the behaviour of this generator| Method Detail |
|---|
public SequenceTable getTable()
public org.datanucleus.store.valuegenerator.ValueGenerationBlock reserveBlock(long size)
reserveBlock in class org.datanucleus.store.valuegenerator.AbstractGeneratorsize - Block size
protected boolean requiresRepository()
requiresRepository in class org.datanucleus.store.valuegenerator.AbstractGeneratorprotected boolean repositoryExists()
repositoryExists in class org.datanucleus.store.valuegenerator.AbstractGeneratorprotected boolean createRepository()
createRepository in class org.datanucleus.store.valuegenerator.AbstractGeneratorprotected void initialiseSequenceTable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||