|
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_clzEntity The entity class that this CacheLoader is managing. |
protected oracle.toplink.essentials.descriptors.ClassDescriptor |
m_descEntity Descriptor for entity class. |
protected boolean |
m_fUsePkClass Flag to indicate whether or not the PK is a composite class. |
protected oracle.toplink.essentials.mappings.DatabaseMapping |
m_mappingPk Database mapping of the PK attribute. |
protected String |
m_sEntityName Name of the entity that this CacheLoader is managing. |
protected oracle.toplink.essentials.sessions.Session |
m_session Shared session for all entities. |
protected String |
m_sPkField Field 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 classpublic 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 CacheLoader
oKey
- key whose associated value is to be returnedpublic Map loadAll(Collection colKeys)
loadAll
in interface CacheLoader
colKeys
- a collection of keys to loadprotected void initialize(String sEntityName, String sSessionName)
sEntityName
- the alias for the persistent classsSessionName
- the name of the TopLink sessionprotected 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 objectprotected 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 |