org.ujorm.orm
Class UjoSequencer

java.lang.Object
  extended by org.ujorm.orm.UjoSequencer

public class UjoSequencer
extends Object

The default sequence provider. A result value is recieved from a special database table.

Author:
Pavel Ponec

Field Summary
protected  long maxValue
          Total limit, zero means no restriction
protected  long seqLimit
          Buffer limit
protected  long sequence
          Current sequence value
protected  MetaTable table
          Basic table.
 
Constructor Summary
UjoSequencer(MetaTable table)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected final MetaTable table
Basic table.


sequence

protected long sequence
Current sequence value


seqLimit

protected long seqLimit
Buffer limit


maxValue

protected long maxValue
Total limit, zero means no restriction

Constructor Detail

UjoSequencer

public UjoSequencer(MetaTable table)
Method Detail

nextValue

public long nextValue(Session session)
Returns the next sequence value by a synchronized method.


getDatabaseSchema

public String getDatabaseSchema()
Returns the database schema


getIncrement

public int getIncrement()
The UJO cache is the number of pre-allocated numbers inside the OrmUjo framework.


getInitDbCache

public int getInitDbCache()
The cache of a database sequence is zero by default.


getDatabase

public MetaDatabase getDatabase()
Returns model of the database


getTable

public MetaTable getTable()
Returns a related table or null if sequence is general for the all MetaDatabase space


isSequenceTableRequired

public boolean isSequenceTableRequired()
Method returns true because the internal table 'ujorm_pk_support' is required to get a next sequence value. In case you have a different imlementation, there is possible overwrite this method and return an another value.



Copyright © 2012. All Rights Reserved.