|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
public abstract class AbstractJDBCSeq
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 Object |
current
|
protected int |
type
|
| Fields inherited from interface org.apache.openjpa.kernel.Seq |
|---|
TYPE_CONTIGUOUS, TYPE_DEFAULT, TYPE_NONTRANSACTIONAL, TYPE_TRANSACTIONAL |
| Constructor Summary | |
|---|---|
AbstractJDBCSeq()
|
|
| Method Summary | |
|---|---|
void |
addSchema(ClassMapping mapping,
SchemaGroup group)
No-op. |
void |
allocate(int additional,
StoreContext ctx,
ClassMetaData meta)
Allocate additional values efficiently. |
protected void |
allocateInternal(int additional,
JDBCStore store,
ClassMapping mapping)
Allocate additional sequence values. |
void |
close()
No-op. |
protected void |
closeConnection(Connection conn)
Close the current connection. |
Object |
current(StoreContext ctx,
ClassMetaData meta)
Return the current value of the sequence, or null if not available. |
protected Object |
currentInternal(JDBCStore store,
ClassMapping mapping)
Return the current sequence object. |
protected Connection |
getConnection(JDBCStore store)
Return the connection to use based on the type of sequence. |
Object |
next(StoreContext ctx,
ClassMetaData meta)
Return the next value in the sequence. |
protected abstract Object |
nextInternal(JDBCStore store,
ClassMapping mapping)
Return the next sequence object. |
void |
setType(int type)
Records the sequence type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int type
protected Object current
| Constructor Detail |
|---|
public AbstractJDBCSeq()
| Method Detail |
|---|
public void setType(int type)
setType in interface Seq
public Object next(StoreContext ctx,
ClassMetaData meta)
Seq
next in interface Seqctx - the current contextmeta - if this is a datastore identity sequence, the
persistent class the identity value is for; else null
public Object current(StoreContext ctx,
ClassMetaData meta)
Seq
current in interface Seqctx - the current contextmeta - if this is a datastore identity sequence, the
persistent class the identity value is for; else null
public void allocate(int additional,
StoreContext ctx,
ClassMetaData meta)
Seq
allocate in interface Seqctx - the current contextmeta - if this is a datastore identity sequence, the
persistent class the identity value is for; else null
public void addSchema(ClassMapping mapping,
SchemaGroup group)
addSchema in interface JDBCSeqpublic void close()
close in interface Seqclose in interface Closeable
protected abstract Object nextInternal(JDBCStore store,
ClassMapping mapping)
throws Exception
Exception
protected Object currentInternal(JDBCStore store,
ClassMapping mapping)
throws Exception
Exception
protected void allocateInternal(int additional,
JDBCStore store,
ClassMapping mapping)
throws Exception
Exception
protected Connection getConnection(JDBCStore store)
throws SQLException
SQLExceptionprotected void closeConnection(Connection conn)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||