public class UjoSequencer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected long |
maxValue
Total limit, zero means no restriction
|
static int |
SEQ_LIMIT
DB field: seqLimit
|
static int |
SEQ_MAX_VALUE
DB field: maxValue
|
static int |
SEQ_STEP
DB field: step
|
protected long |
seqLimit
Buffer limit
|
protected long |
sequence
Current sequence value
|
protected MetaTable |
table
Basic table.
|
| Constructor and Description |
|---|
UjoSequencer(MetaTable table) |
| Modifier and Type | Method and Description |
|---|---|
long[] |
getCurrentDBSequence(Connection connection,
StringBuilder sql)
Returns current db sequence for an actual table with a performance optimizations.
|
MetaDatabase |
getDatabase()
Returns model of the database
|
String |
getDatabaseSchema()
Returns the database schema
|
int |
getIncrement()
The UJO cache is the number of pre-allocated numbers inside the OrmUjo framework.
|
int |
getInitDbCache()
The cache of a database sequence is zero by default.
|
MetaTable |
getTable()
Returns a related table or null if sequence is general for the all MetaDatabase space
|
boolean |
isSequenceTableRequired()
Method returns true because the internal table 'ujorm_pk_support' is required to get a next sequence value.
|
long |
nextValue(Session session)
Returns the next sequence value by a synchronized method.
|
void |
reset()
Forces to reload sequence from db on next call for nextValue.
|
public static final int SEQ_LIMIT
public static final int SEQ_STEP
public static final int SEQ_MAX_VALUE
protected final MetaTable table
protected long sequence
protected long seqLimit
protected long maxValue
public UjoSequencer(MetaTable table)
public long nextValue(Session session)
public String getDatabaseSchema()
public int getIncrement()
public int getInitDbCache()
public MetaDatabase getDatabase()
public MetaTable getTable()
public boolean isSequenceTableRequired()
public void reset()
public long[] getCurrentDBSequence(Connection connection, StringBuilder sql) throws Exception
connection - Connectionsql - Temporarry buffer for a better performance. The value can be null a not null will be cleaned allways.null.ExceptionCopyright 2013, Pavel Ponec