|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-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 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 String |
m_sEntityNameName of the entity that this CacheLoader is managing. |
protected oracle.toplink.essentials.sessions.Session |
m_sessionShared session for all entities. |
protected String |
m_sPkFieldField name of the PK attribute. |
| Constructor Summary | |
|---|---|
TopLinkCacheLoader(String sEntityName)Constructor which accepts an entity name. |
|
TopLinkCacheLoader(String sEntityName, String sSessionName)Constructor which accepts an entity name and session name. |
|
| Method Summary | |
|---|---|
protected void |
initialize(String sEntityName, String sSessionName)Initialize the instance with the relevant metadata for the entity being stored. |
Object |
load(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. |
Map |
loadAll(Collection colKeys)Return the values associated with each the specified keys in the passed collection. |
protected Object |
queryByPk(oracle.toplink.essentials.sessions.UnitOfWork uow, Object oKey)Internal method to create and execute a "findByPK" query. |
protected Object |
queryByPkCollection(oracle.toplink.essentials.sessions.UnitOfWork uow, Collection colPk)Internal method to create and execute a query to find in a group of PKs. |
| Field Detail |
|---|
protected String m_sEntityName
protected Class m_clzEntity
protected boolean m_fUsePkClass
protected oracle.toplink.essentials.mappings.DatabaseMapping m_mappingPk
protected String m_sPkField
protected oracle.toplink.essentials.descriptors.ClassDescriptor m_descEntity
protected oracle.toplink.essentials.sessions.Session m_session
| Constructor Detail |
|---|
public TopLinkCacheLoader(String sEntityName)
sEntityName - the alias for the persistent class
public TopLinkCacheLoader(String sEntityName,
String sSessionName)
sEntityName - the alias for the persistent classsSessionName - the name of the TopLink session (usually defined in sessions.xml)| Method Detail |
|---|
public Object load(Object oKey)
load in interface CacheLoaderoKey - key whose associated value is to be returnedpublic Map loadAll(Collection colKeys)
loadAll in interface CacheLoadercolKeys - a collection of keys to load
protected void initialize(String sEntityName,
String sSessionName)
sEntityName - the alias for the persistent classsSessionName - the name of the TopLink session
protected Object queryByPk(oracle.toplink.essentials.sessions.UnitOfWork uow,
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 Object queryByPkCollection(oracle.toplink.essentials.sessions.UnitOfWork uow,
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 Release 3.6.0.0 E15725-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||