Business Components

oracle.jbo.server
Class EntityCache

java.lang.Object
  |
  +--oracle.jbo.server.EntityCache

public class EntityCache
extends java.lang.Object

The EntityCache caches queried rows for a particular EntityImpl.

Version:
SDK

Constructor Summary
EntityCache()
          Constructor.
 
Method Summary
TypeMethod
protected  EntityImpl add(EntityImpl srow)
          Add an Entity to the cache.
 void addEntityListener(EntityListener listener)
          Add an EntityListener.
protected  void clearCache()
           
protected  void deliverEntityEvent(EntityEvent event)
          Notify EntityListeners of a EntityImpl properties or state has changed.
protected  EntityDefImpl getEntityDef()
           
protected  void init(DBTransactionImpl trans, EntityDefImpl entityDef)
           
 void removeEntityListener(EntityListener listener)
          Remove an EntityListener.
protected  EntityImpl removeRow(EntityImpl srow)
          Remove a EntityImpl from the cache.
protected  void replace(EntityImpl srow, Key okey)
          Remove a row in cache and add it in using the new key values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityCache

public EntityCache()
Constructor.
Method Detail

init

protected void init(DBTransactionImpl trans,
                    EntityDefImpl entityDef)

getEntityDef

protected EntityDefImpl getEntityDef()

add

protected EntityImpl add(EntityImpl srow)
Add an Entity to the cache. TODO: This really should check for conflicts between the EntityDefImpl of the row and the cache.
Parameters:
srow - the row to be added.

removeRow

protected EntityImpl removeRow(EntityImpl srow)
Remove a EntityImpl from the cache.
Parameters:
srow - the row to be removed.

clearCache

protected void clearCache()

addEntityListener

public void addEntityListener(EntityListener listener)
Add an EntityListener.
Parameters:
listener - The object to be registered as listener.

removeEntityListener

public void removeEntityListener(EntityListener listener)
Remove an EntityListener.
Parameters:
listener - The object to be removed from the list of listeners.

deliverEntityEvent

protected void deliverEntityEvent(EntityEvent event)
Notify EntityListeners of a EntityImpl properties or state has changed.
Parameters:
sRow - The EntityImpl on which event has occurred.
eventType - The type of event.

replace

protected void replace(EntityImpl srow,
                       Key okey)
Remove a row in cache and add it in using the new key values. This is used when the key values changed by the user or from RETURNING clause on INSERT or UPDATE.
Parameters:
srow - the row to be replaced.
okey - the original key.

Business Components