| java.lang.Object org.openharmonise.commons.cache.AbstractCache org.openharmonise.rm.dsi.ColumnRefCache
ColumnRefCache | public class ColumnRefCache extends AbstractCache (Code) | | Cache of ColumnRef objects used within Harmonise.
Column references are stored with a cache key composed of the class
name, column name and a boolean of whether the column referfence refers
to a historical table or not.
Note: Care should be used in dealing with ColumnRef objects
taken from this cache as they are mutable and therefore there is a risk
associated to any changes you might make to an object taken from
the cache. For example, it is possible to reset the table name associated
to the column reference to accomodate an alias in a select statement
maybe, however this could possibly break further use.
author: mike version: $Revision: 1.2 $ |
Method Summary | |
public void | addToCache(Class clss, String sColumn, boolean bIsHist, ColumnRef colref) Adds the given ColumnRef to this cache for the given
column associated to the given class. | protected String | getCacheKey(Class clss, String sColumn, boolean bIsHist) Returns a unique key to be used in the cache composed of the
combination of class, column and historical boolean. | protected String | getCacheKey(String sTable, String sColumn, boolean bIsHist) Returns a unique key to be used in the cache composed the combination
of class, column and historical boolean. | protected Object | getCacheableObject(Object key) | public ColumnRef | getColumnRef(DataStoreObject dsObj, String sColumn, boolean bIsHist) Returns a cached ColumnRef for the given column associated
to the given DataStoreObject . | public ColumnRef | getColumnRef(Class clss, String sColumn, boolean bIsHist) Returns a cached ColumnRef for the given column associated
to the given class if there is one in the cache, otherwise a null is returned. | public static ColumnRefCache | getInstance() | public Object | getObject(Object key) |
addToCache | public void addToCache(Class clss, String sColumn, boolean bIsHist, ColumnRef colref)(Code) | | Adds the given ColumnRef to this cache for the given
column associated to the given class.
Parameters: clss - the class of the data store object associated to given the ColumnRef Parameters: sColumn - the database column name Parameters: bIsHist - true of the column is in the historical table, otherwise false Parameters: colref - the column reference to cache |
getCacheKey | protected String getCacheKey(Class clss, String sColumn, boolean bIsHist)(Code) | | Returns a unique key to be used in the cache composed of the
combination of class, column and historical boolean.
Parameters: clss - the class name Parameters: sColumn - the column name Parameters: bIsHist - true if the column is in the historical table, otherwise false a unique key for the column reference |
getCacheKey | protected String getCacheKey(String sTable, String sColumn, boolean bIsHist)(Code) | | Returns a unique key to be used in the cache composed the combination
of class, column and historical boolean.
Parameters: clss - the class name Parameters: sColumn - the column name Parameters: bIsHist - true if the column is in the historical table, otherwise false a unique key for the column reference |
getColumnRef | public ColumnRef getColumnRef(DataStoreObject dsObj, String sColumn, boolean bIsHist) throws CacheException(Code) | | Returns a cached ColumnRef for the given column associated
to the given DataStoreObject . If the ColumnRef
is not in the cache it is retrieved from the object's getInstanceColumnRef
method.
Note: this method calls the getInstanceColumnRef and
therefore should not be used in the getInstanceColumnRef
method of a DataStoreObject in order to avoid an
ininite loop.
Parameters: dsObj - the data store object Parameters: sColumn - the database column name Parameters: bIsHist - true of the column is in the historical table, otherwise false the ColumnRef associated with the specified database column throws: CacheException - if an error occurs obtaining the ColumnRef |
getColumnRef | public ColumnRef getColumnRef(Class clss, String sColumn, boolean bIsHist) throws CacheException(Code) | | Returns a cached ColumnRef for the given column associated
to the given class if there is one in the cache, otherwise a null is returned.
Parameters: clss - the Class of a DataStoreObject Parameters: sColumn - the database column name Parameters: bIsHist - true of the column is in the historical table, otherwise false a cached ColumnRef for the specified database column throws: CacheException - if any errors occur |
|
|