bill.util.persist
Class EntityDataFactoryRDBMS

java.lang.Object
  |
  +--bill.util.persist.EntityDataFactory
        |
        +--bill.util.persist.EntityDataFactoryRDBMS

public abstract class EntityDataFactoryRDBMS
extends EntityDataFactory

Factory for RDBMS entities. The factory contains data and access methods specific to a RDBMS persistence implementation. This includes logic to retrieve "sequence" numbers.


Fields inherited from class bill.util.persist.EntityDataFactory
_connection
 
Constructor Summary
EntityDataFactoryRDBMS()
           
 
Method Summary
static Connection getDBConnection()
          Retrieve a database connection for our use in manipulating the database's data.
static long getNextSequence(String sequenceName)
          Gets the next sequence value for the specified sequence name.
 
Methods inherited from class bill.util.persist.EntityDataFactory
getConnection, setConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityDataFactoryRDBMS

public EntityDataFactoryRDBMS()
Method Detail

getDBConnection

public static Connection getDBConnection()
Retrieve a database connection for our use in manipulating the database's data. This is a convenient way of calling getConnection that returns us a Connection rather than an Object, saving us from constantly typecasting.
Returns:
The database connection.

getNextSequence

public static long getNextSequence(String sequenceName)
Gets the next sequence value for the specified sequence name. This method is serialized to make sure we do not hand out the same sequence value to multiple callers. Sequences are stored in a "sequence" database table. After retrieving the next sequence value we increment the databases next sequence value.
Parameters:
sequenceName - The name of the sequence to retrieve.
Returns:
The retrieved sequence value.