|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujorm.orm.UjoSequencer
public class UjoSequencer
The default sequence provider. A result value is recieved from a special database table.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
UjoSequencer(MetaTable table)
|
|
| Method Summary | |
|---|---|
protected int |
executeSql(Connection connection,
String sql,
String tableName)
Executes UPDATE for required parameters |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public UjoSequencer(MetaTable table)
| Method Detail |
|---|
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 always.
null.
Exception
protected int executeSql(Connection connection,
String sql,
String tableName)
throws SQLException
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||