|
Oracle® Coherence Java API Reference v3.5 E14977-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.Base
com.tangosol.coherence.toplink.TopLinkCacheLoader
public class TopLinkCacheLoader
TopLink implementation of the CacheLoader interface. <p/> Use this class as a load-only implementation that uses TopLink to load entities to and from a data store. The entities must be mapped to the data store and a TopLink session configuration or TopLink JPA persistence unit configuration must exist on the classpath. <p/> Use the TopLinkCacheStore class for a full load and store implementation.
TopLinkCacheStore| Field Summary | |
|---|---|
protected java.lang.Class |
m_clzEntityThe entity class that this CacheLoader is managing. |
protected oracle.toplink.essentials.descriptors.ClassDescriptor |
m_descEntityDescriptor for entity class. |
protected boolean |
m_fUsePkClassFlag to indicate whether or not the PK is a composite class. |
protected oracle.toplink.essentials.mappings.DatabaseMapping |
m_mappingPkDatabase mapping of the PK attribute. |
protected java.lang.String |
m_sEntityNameName of the entity that this CacheLoader is managing. |
protected oracle.toplink.essentials.sessions.Session |
m_sessionShared session for all entities. |
protected java.lang.String |
m_sPkFieldField name of the PK attribute. |
| Constructor Summary | |
|---|---|
TopLinkCacheLoader(java.lang.String sEntityName)Constructor which accepts an entity name. |
|
TopLinkCacheLoader(java.lang.String sEntityName, java.lang.String sSessionName)Constructor which accepts an entity name and session name. |
|
| Method Summary | |
|---|---|
protected void |
initialize(java.lang.String sEntityName, java.lang.String sSessionName)Initialize the instance with the relevant metadata for the entity being stored. |
java.lang.Object |
load(java.lang.Object oKey)Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store. |
java.util.Map |
loadAll(java.util.Collection colKeys)Return the values associated with each the specified keys in the passed collection. |
protected java.lang.Object |
queryByPk(oracle.toplink.essentials.sessions.UnitOfWork uow, java.lang.Object oKey)Internal method to create and execute a "findByPK" query. |
protected java.lang.Object |
queryByPkCollection(oracle.toplink.essentials.sessions.UnitOfWork uow, java.util.Collection colPk)Internal method to create and execute a query to find in a group of PKs. |
| Field Detail |
|---|
protected java.lang.String m_sEntityName
protected java.lang.Class m_clzEntity
protected boolean m_fUsePkClass
protected oracle.toplink.essentials.mappings.DatabaseMapping m_mappingPk
protected java.lang.String m_sPkField
protected oracle.toplink.essentials.descriptors.ClassDescriptor m_descEntity
protected oracle.toplink.essentials.sessions.Session m_session
| Constructor Detail |
|---|
public TopLinkCacheLoader(java.lang.String sEntityName)
sEntityName - the alias for the persistent class
public TopLinkCacheLoader(java.lang.String sEntityName,
java.lang.String sSessionName)
sEntityName - the alias for the persistent classsSessionName - the name of the TopLink session (usually defined in sessions.xml)| Method Detail |
|---|
public java.lang.Object load(java.lang.Object oKey)
load in interface CacheLoaderoKey - key whose associated value is to be returnedpublic java.util.Map loadAll(java.util.Collection colKeys)
loadAll in interface CacheLoadercolKeys - a collection of keys to load
protected void initialize(java.lang.String sEntityName,
java.lang.String sSessionName)
sEntityName - the alias for the persistent classsSessionName - the name of the TopLink session
protected java.lang.Object queryByPk(oracle.toplink.essentials.sessions.UnitOfWork uow,
java.lang.Object oKey)
uow - the unit of work to use for the operation; if null use the sessionoKey - the primary key to use to find the object
protected java.lang.Object queryByPkCollection(oracle.toplink.essentials.sessions.UnitOfWork uow,
java.util.Collection colPk)
uow - the unit of work to use for the operation; if null use the sessioncolPk - the Collection of primary keys to use to find the entity instances
|
Oracle® Coherence Java API Reference v3.5 E14977-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||