org.apache.openjpa.kernel
Interface Seq

All Superinterfaces:
Closeable
All Known Subinterfaces:
JDBCSeq
All Known Implementing Classes:
AbstractJDBCSeq, ClassTableJDBCSeq, DelegatingSeq, NativeJDBCSeq, TableJDBCSeq, TimeSeededSeq, UUIDHexSeq, UUIDStringSeq, UUIDType4HexSeq, UUIDType4StringSeq, ValueTableJDBCSeq

public interface Seq
extends Closeable

Internal OpenJPA sequence interface.

Author:
Abe White

Field Summary
static int TYPE_CONTIGUOUS
           
static int TYPE_DEFAULT
           
static int TYPE_NONTRANSACTIONAL
           
static int TYPE_TRANSACTIONAL
           
 
Method Summary
 void allocate(int additional, StoreContext ctx, ClassMetaData cls)
          Allocate additional values efficiently.
 void close()
          Free resources used by this sequence.
 Object current(StoreContext ctx, ClassMetaData cls)
          Return the current value of the sequence, or null if not available.
 Object next(StoreContext ctx, ClassMetaData cls)
          Return the next value in the sequence.
 void setType(int type)
          Set the type of sequence.
 

Field Detail

TYPE_DEFAULT

static final int TYPE_DEFAULT
See Also:
Constant Field Values

TYPE_NONTRANSACTIONAL

static final int TYPE_NONTRANSACTIONAL
See Also:
Constant Field Values

TYPE_TRANSACTIONAL

static final int TYPE_TRANSACTIONAL
See Also:
Constant Field Values

TYPE_CONTIGUOUS

static final int TYPE_CONTIGUOUS
See Also:
Constant Field Values
Method Detail

setType

void setType(int type)
Set the type of sequence.


next

Object next(StoreContext ctx,
            ClassMetaData cls)
Return the next value in the sequence.

Parameters:
ctx - the current context
cls - if this is a datastore identity sequence, the persistent class the identity value is for; else null

current

Object current(StoreContext ctx,
               ClassMetaData cls)
Return the current value of the sequence, or null if not available.

Parameters:
ctx - the current context
cls - if this is a datastore identity sequence, the persistent class the identity value is for; else null

allocate

void allocate(int additional,
              StoreContext ctx,
              ClassMetaData cls)
Allocate additional values efficiently.

Parameters:
ctx - the current context
cls - if this is a datastore identity sequence, the persistent class the identity value is for; else null

close

void close()
Free resources used by this sequence.

Specified by:
close in interface Closeable


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.