public class SequenceTable extends TableImpl
columns, columnsByName, dba, existsInDatastore, identifier, state, storeMgr, TABLE_STATE_INITIALIZED, TABLE_STATE_INITIALIZED_MODIFIED, TABLE_STATE_NEW, TABLE_STATE_PK_INITIALIZED, TABLE_STATE_VALIDATED
Constructor and Description |
---|
SequenceTable(DatastoreIdentifier identifier,
RDBMSStoreManager storeMgr,
String seqNameColName,
String nextValColName)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
deleteAllSequences(org.datanucleus.store.connection.ManagedConnection conn)
Method to delete all sequences
|
void |
deleteSequence(String sequenceName,
org.datanucleus.store.connection.ManagedConnection conn)
Method to delete a sequence.
|
HashSet |
getFetchAllSequences(org.datanucleus.store.connection.ManagedConnection conn)
Accessor for the sequences
|
JavaTypeMapping |
getIdMapping()
Accessor for a mapping for the ID (persistable) for this table.
|
JavaTypeMapping |
getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor the for the mapping for a field store in this table
|
Long |
getNextVal(String sequenceName,
org.datanucleus.store.connection.ManagedConnection conn,
int incrementBy,
DatastoreIdentifier tableIdentifier,
String columnName,
int initialValue)
Accessor for the nextval of a sequence
|
void |
initialize(org.datanucleus.ClassLoaderResolver clr)
Method to initialise the table.
|
createConstraints, dropConstraints, getExpectedCandidateKeys, getExpectedForeignKeys, getExpectedIndices, getPrimaryKey, getSQLAddCandidateKeyStatements, getSQLAddFKStatements, getSQLCreateIndexStatements, getSQLCreateStatements, getSQLDropStatements, initializeColumnInfoForPrimaryKeyColumns, initializeColumnInfoFromDatastore, logMapping, postInitialize, preInitialize, validate, validateColumns, validateConstraints, validatePrimaryKey
addColumn, addColumnInternal, allowDDLOutput, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getClassMetaData, getColumn, getColumnForName, getColumnForPosition, getColumns, getDatastoreIdColumn, getDatastoreIdentifierFullyQualified, getDiscriminatorColumn, getDiscriminatorMapping, getDiscriminatorMetaData, getIdentifier, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getMultitenancyColumn, getMultitenancyMapping, getName, getNumberOfColumns, getSchemaName, getStoreManager, getVersionColumn, getVersionMapping, getVersionMetaData, hasColumn, hasColumnName, hashCode, isInitialized, isInitializedModified, isPKInitialized, isValidated, tableExistsInDatastore, toString
public SequenceTable(DatastoreIdentifier identifier, RDBMSStoreManager storeMgr, String seqNameColName, String nextValColName)
identifier
- Datastore identifier for this tablestoreMgr
- The RDBMSManager for this datastoreseqNameColName
- Name for the "sequence name" columnnextValColName
- Name for the "next value" columnpublic void initialize(org.datanucleus.ClassLoaderResolver clr)
clr
- The ClassLoaderResolverpublic JavaTypeMapping getIdMapping()
public HashSet getFetchAllSequences(org.datanucleus.store.connection.ManagedConnection conn) throws SQLException
conn
- Connection for this datastore.SQLException
- Thrown when an error occurs in the process.public Long getNextVal(String sequenceName, org.datanucleus.store.connection.ManagedConnection conn, int incrementBy, DatastoreIdentifier tableIdentifier, String columnName, int initialValue) throws SQLException
conn
- Connection for this datastore.sequenceName
- The sequence name (the key)incrementBy
- The amount to increment (from the current value)tableIdentifier
- Identifier for the table being incremented (used when there is no current value)columnName
- Name of the column being incremented (used when there is no current value)initialValue
- Initial value (if not using tableIdentifier/columnName to find the initial value)SQLException
- Thrown when an error occurs in the process.public void deleteSequence(String sequenceName, org.datanucleus.store.connection.ManagedConnection conn) throws SQLException
sequenceName
- Name of the sequenceconn
- Connection to the datastoreSQLException
- Thrown when an error occurs deleting the schema.public void deleteAllSequences(org.datanucleus.store.connection.ManagedConnection conn) throws SQLException
conn
- Connection to the datastoreSQLException
- Thrown when an error occurs deleting.public JavaTypeMapping getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
mmd
- MetaData for the field whose mapping we wantCopyright © 2015. All rights reserved.