Save This Page
Home » apache-openjpa-1.1.0-source » org.apache.openjpa.jdbc » kernel » [javadoc | source]
org.apache.openjpa.jdbc.kernel
abstract public class: AbstractJDBCSeq [javadoc | source]
java.lang.Object
   org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq

All Implemented Interfaces:
    JDBCSeq

Direct Known Subclasses:
    ValueTableJDBCSeq, NativeJDBCSeq, ClassTableJDBCSeq, TableJDBCSeq

Abstract sequence implementation. Handles obtaining the proper connection to used based on whether the sequence is transactional and whether a second datasource is configured.
Field Summary
protected  int type     
protected  Object current     
Method from org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq Summary:
addSchema,   allocate,   allocateInternal,   close,   closeConnection,   current,   currentInternal,   getConfiguration,   getConnection,   next,   nextInternal,   setType,   suspendInJTA
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq Detail:
 public  void addSchema(ClassMapping mapping,
    SchemaGroup group) 
    No-op.
 public  void allocate(int additional,
    StoreContext ctx,
    ClassMetaData meta) 
 protected  void allocateInternal(int additional,
    JDBCStore store,
    ClassMapping mapping) throws Exception 
    Allocate additional sequence values. Does nothing by default.
 public  void close() 
    No-op.
 protected  void closeConnection(Connection conn) 
    Close the current connection.
 public Object current(StoreContext ctx,
    ClassMetaData meta) 
 protected Object currentInternal(JDBCStore store,
    ClassMapping mapping) throws Exception 
    Return the current sequence object. By default returns the last sequence value used, or null if no sequence values have been requested yet. Default implementation is not threadsafe.
 abstract public JDBCConfiguration getConfiguration()
 protected Connection getConnection(JDBCStore store) throws SQLException 
    Return the connection to use based on the type of sequence. This connection will automatically be closed; do not close it.
 public Object next(StoreContext ctx,
    ClassMetaData meta) 
 abstract protected Object nextInternal(JDBCStore store,
    ClassMapping mapping) throws Exception
    Return the next sequence object.
 public  void setType(int type) 
    Records the sequence type.
 protected boolean suspendInJTA() 
    Detect whether or not OpenJPA should suspend the transaction in a managed environment.