| org.xorm.cache.DataCache
All known Subclasses: org.xorm.datastore.heap.HeapDatastore, org.xorm.cache.LRUCache,
DataCache | public interface DataCache extends Configurable(Code) | | The interface for a XORM cache. The cache contains Row objects.
It is up to an implementation to determine the cache strategy and
layout. A cache is not required to hold a reference for any period
of time. The only requirements are as follows:
- If the get(table,primaryKey) does not return null, its
return value must be equal (.equals()) to the most recently added Row
where row.getTable() and row.getPrimaryKeyValue()
are equal (.equals()) to the parameters.
- remove(row) must remove the given row from the cache (by
.equals()). That is, if remove(row) is called, an immediate call
to get(row.getTable(), row.getPrimaryKeyValue()) must return null.
- The cache must not call any methods that would modify the internal
contents of a Row (for example, row.setValue()).
The cache implementation may take arbitrary parameters specified in the
JDO initialization properties set.
|
Method Summary | |
public void | add(Row row) Adds or replaces the Row in the cache. | public Row | get(Table table, Object primaryKey) Retrieves the Row from the cache with the
matching primary key. | public void | remove(Row row) Removes a Row from the cache by its primary key. |
add | public void add(Row row)(Code) | | Adds or replaces the Row in the cache. If the Table does not
have a primary key defined, the implementation is not required
to cache it.
|
get | public Row get(Table table, Object primaryKey)(Code) | | Retrieves the Row from the cache with the
matching primary key.
a row matching the criteria, or null |
remove | public void remove(Row row)(Code) | | Removes a Row from the cache by its primary key. If no matching
row exists, no change is made. Implementations of this method
should use the .equals() operator for Row comparisons.
|
|
|