com.is.jrf
Class AbstractStaticDomain

java.lang.Object
  |
  +--com.is.jrf.AbstractDomain
        |
        +--com.is.jrf.AbstractStaticDomain
All Implemented Interfaces:
JRFConstants

public abstract class AbstractStaticDomain
extends AbstractDomain

This abstract superclass caches the PersistentObjects for it's subclasses. Subclasses of this abstract class should represent relatively small lookup tables that rarely or never change. i.e. a Gender table with two rows. One row for male, and one for female. The resulting PersistentObjects are cached so that calls to find() or findAll() return the cached instances instead. The cache uses a ThreadLocal instance so this should be able to be used in a multi-threaded environment where the threads are pooled. If the threads are not pooled then using this superclass may not benefit the performance of the application much. In a single-threaded environment this will work fine too.


Inner classes inherited from class com.is.jrf.AbstractDomain
AbstractDomain.RowHandler
 
Fields inherited from interface com.is.jrf.JRFConstants
CURRENT_DATE, CURRENT_TIMESTAMP, DEFAULT_TO_EMPTY_STRING, DEFAULT_TO_FALSE, DEFAULT_TO_NOW, DEFAULT_TO_NULL, DEFAULT_TO_ONE, DEFAULT_TO_TODAY, DEFAULT_TO_TRUE, DEFAULT_TO_ZERO, EQUALS, NATURAL_PRIMARY_KEY, NO_POST_FIND, NOT_EQUALS, OPTIMISTIC_LOCK, REQUIRED, SEQUENCED_PRIMARY_KEY, SUBTYPE_IDENTIFIER, UNIQUE
 
Constructor Summary
AbstractStaticDomain()
           
AbstractStaticDomain(int option)
           
 
Method Summary
 PersistentObject find(java.lang.Object pkOrPO, JDBCHelper aJDBCHelper)
          This is a method override that gets its objects from the cache.
 java.util.List findAll(JDBCHelper aJDBCHelper)
          Return all of the instances that are in the cache.
 
Methods inherited from class com.is.jrf.AbstractDomain
addColumnSpec, addJoinTable, addSubtypeColumnSpec, addSubtypeDomain, beginTransaction, beginTransaction, convertToPersistentObject, convertToSubtypePersistentObject, copyAttributes, createTable, createTable, decodePrimaryKey, delete, delete, delimitString, dropTable, dropTable, encodePrimaryKey, endTransaction, endTransaction, executeSQLQuery, executeSQLQuery, executeSQLUpdate, executeSQLUpdate, finalFind, find, find, find, findAll, findCurrentTimestamp, findCurrentTimestamp, findCustom, findCustom, findInteger, findInteger, findLong, findLong, findOrderBy, findOrderBy, findWhere, findWhere, findWhereOrderBy, findWhereOrderBy, getAllColumnSpecs, getColumnSpecs, getCreateTableSQLBuilder, getDatabasePolicy, getEndingIndex, getInsertSQLBuilder, getJDBCHelper, getJDBCHelperPool, getJoinTables, getPrimaryKeyColumnSpec, getReturnSavedObject, getSelectSQLBuilder, getShouldAutoCommit, getStartingIndex, getSubtypeColumnSpecs, getSubtypeTable, getSubtypeTableName, getTableAlias, getTableName, getUpdateSQLBuilder, getValidateBeforeSaving, newPersistentObject, nextSequence, postDelete, postFind, postSave, preDelete, preSave, preValidate, quietlyRollbackAndClose, resetStartingAndEndingIndexes, save, save, setDatabasePolicy, setEndingIndex, setJDBCHelper, setJDBCHelperPool, setJDBCHelperPoolName, setReturnSavedObject, setShouldAutoCommit, setStartingIndex, setSubtypeTableName, setTableAlias, setTableName, setup, setUseANSIJoins, setUsePostFind, setValidateBeforeSaving, useANSIJoins, usePostFind, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStaticDomain

public AbstractStaticDomain()

AbstractStaticDomain

public AbstractStaticDomain(int option)
Method Detail

find

public PersistentObject find(java.lang.Object pkOrPO,
                             JDBCHelper aJDBCHelper)
This is a method override that gets its objects from the cache.
Overrides:
find in class AbstractDomain
Parameters:
pkOrPO - a value of type 'Object'
aJDBCHelper - a value of type 'JDBCHelper' - not used but needed to match the signature of the overridden method.
Returns:
a value of type 'PersistentObject'

findAll

public java.util.List findAll(JDBCHelper aJDBCHelper)
Return all of the instances that are in the cache.
Overrides:
findAll in class AbstractDomain
Parameters:
aJDBCHelper - a value of type 'JDBCHelper'
Returns:
a value of type 'List'