org.jpox.store.rdbms.table
Class SequenceTable

java.lang.Object
  extended byorg.jpox.store.rdbms.table.AbstractTable
      extended byorg.jpox.store.rdbms.table.TableImpl
          extended byorg.jpox.store.rdbms.table.SequenceTable
All Implemented Interfaces:
DatastoreContainerObject, DatastoreObject, Table

public class SequenceTable
extends TableImpl

Class defining a table sequence for unique identifiers

Version:
$Revision: 1.32 $

Field Summary
 
Fields inherited from class org.jpox.store.rdbms.table.AbstractTable
columns, columnsByName, dba, ddlDumpWriter, identifier, LOCALISER, state, storeMgr
 
Fields inherited from interface org.jpox.store.rdbms.table.Table
TABLE_STATE_INITIALIZED, TABLE_STATE_INITIALIZED_MODIFIED, TABLE_STATE_NEW, TABLE_STATE_PK_INITIALIZED, TABLE_STATE_VALIDATED, TABLE_TYPE_MISSING, TABLE_TYPE_TABLE, TABLE_TYPE_UNKNOWN, TABLE_TYPE_VIEW
 
Constructor Summary
SequenceTable(RDBMSManager storeMgr, java.util.Properties props)
          Constructor
 
Method Summary
 void deleteAllSequences(java.sql.Connection conn)
          Method to delete all sequences
 void deleteSequence(java.lang.String sequenceName, java.sql.Connection conn)
          Method to delete a sequence
 java.util.HashSet getFetchAllSequences(java.sql.Connection conn)
          Accessor for the sequences
 JavaTypeMapping getFieldMapping(AbstractPropertyMetaData fmd)
          Accessor the for the mapping for a field store in this table
 JavaTypeMapping getIDMapping()
          Accessor for a mapping for the ID (PersistenceCapable) for this table.
 java.lang.Long getNextVal(java.lang.String sequenceName, java.sql.Connection conn, int incrementBy)
          Accessor for the nextval of a sequence
 void initialize(ClassLoaderResolver clr)
          Method to initialise the table.
 
Methods inherited from class org.jpox.store.rdbms.table.TableImpl
dropConstraints, getExpectedCandidateKeys, getExpectedForeignKeys, getExpectedIndices, getPrimaryKey, getSQLAddCandidateKeyStatements, getSQLAddFKStatements, getSQLCreateIndexStatements, getSQLCreateStatements, getSQLDropStatements, initializeColumnInfoForPrimaryKeyColumns, initializeColumnInfoFromDatastore, postInitialize, preInitialize, validate, validateColumns, validateConstraints, validatePrimaryKey
 
Methods inherited from class org.jpox.store.rdbms.table.AbstractTable
addColumnInternal, addDatastoreField, allowDdlDump, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getDatastoreIdentifierFullyQualified, getDiscriminatorMapping, getDiscriminatorMetaData, getIdentifier, getSchemaName, getStoreManager, getVersionMapping, getVersionMetaData, hasColumnName, hasDatastoreField, hashCode, isDumpingDdl, isInitialized, isInitializedModified, isPKInitialized, isValidated, setDdlDumpWriter, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequenceTable

public SequenceTable(RDBMSManager storeMgr,
                     java.util.Properties props)
Constructor

Parameters:
storeMgr - The RDBMSManager for this datastore
props - The properties to define the table name and column names
Method Detail

initialize

public void initialize(ClassLoaderResolver clr)
Method to initialise the table.

Parameters:
clr - The ClassLoaderResolver

getIDMapping

public JavaTypeMapping getIDMapping()
Accessor for a mapping for the ID (PersistenceCapable) for this table.

Returns:
The (PersistenceCapable) ID mapping.

getFetchAllSequences

public java.util.HashSet getFetchAllSequences(java.sql.Connection conn)
                                       throws java.sql.SQLException
Accessor for the sequences

Parameters:
conn - Connection for this datastore.
Returns:
The HashSet of Sequence names
Throws:
java.sql.SQLException - Thrown when an error occurs in the process.

getNextVal

public java.lang.Long getNextVal(java.lang.String sequenceName,
                                 java.sql.Connection conn,
                                 int incrementBy)
                          throws java.sql.SQLException
Accessor for the nextval of a sequence

Parameters:
conn - Connection for this datastore.
sequenceName - The sequence name
incrementBy - The amount to increment
Returns:
The HashSet of Sequence names
Throws:
java.sql.SQLException - Thrown when an error occurs in the process.

deleteSequence

public void deleteSequence(java.lang.String sequenceName,
                           java.sql.Connection conn)
                    throws java.sql.SQLException
Method to delete a sequence

Parameters:
sequenceName -
conn - Connection to the datastore
Throws:
java.sql.SQLException - Thrown when an error occurs deleting the schema.

deleteAllSequences

public void deleteAllSequences(java.sql.Connection conn)
                        throws java.sql.SQLException
Method to delete all sequences

Parameters:
conn - Connection to the datastore
Throws:
java.sql.SQLException - Thrown when an error occurs deleting.

getFieldMapping

public JavaTypeMapping getFieldMapping(AbstractPropertyMetaData fmd)
Accessor the for the mapping for a field store in this table

Parameters:
fmd - MetaData for the field whose mapping we want
Returns:
The mapping


Copyright © -2007 . All Rights Reserved.