|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-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.jpa.JpaCacheLoader
public class JpaCacheLoader
JPA implementation of the CacheLoader
interface.
Use this class as a load-only implementation that uses any JPA implementation to load entities from a data store. The entities must be mapped to the data store and a JPA persistence unit configuration must exist.
Use the JpaCacheStore
class for a full load and store implementation.
JpaCacheStore
Field Summary | |
---|---|
protected javax.persistence.EntityManagerFactory |
m_emf The EntityManagerFactory from which EntityManager instances are obtained. |
protected java.lang.Class |
m_sEntityClass The entity class that this CacheLoader is managing. |
protected java.lang.String |
m_sEntityName Name of the entity that this CacheLoader is managing. |
protected static java.util.Map |
s_mapFactories Map of all shared entity manager factories for all persistence units. |
Constructor Summary | |
---|---|
JpaCacheLoader(java.lang.String sEntityName, java.lang.String sEntityClassName, java.lang.String sUnitName) Constructor which accepts an entity name, class name, and persistence unit name. |
|
JpaCacheLoader(java.lang.String sEntityName, java.lang.String sEntityClassName, java.lang.String sUnitName, java.lang.ClassLoader loader) Constructor which accepts an entity name, class name, persistence unit name, and classloader. |
Method Summary | |
---|---|
protected javax.persistence.EntityManager |
getEntityManager() Creates and returns an EntityManager. |
protected void |
initialize(java.lang.String sEntityName, java.lang.String sEntityClassName, java.lang.String sUnitName, java.lang.ClassLoader loader) Initialize this 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. |
Field Detail |
---|
protected static final java.util.Map s_mapFactories
protected java.lang.String m_sEntityName
protected java.lang.Class m_sEntityClass
protected javax.persistence.EntityManagerFactory m_emf
Constructor Detail |
---|
public JpaCacheLoader(java.lang.String sEntityName, java.lang.String sEntityClassName, java.lang.String sUnitName)
sEntityName
- the JPA name of the entitysEntityClassName
- the fully-qualified class name of the entitysUnitName
- the name of the persistence unitpublic JpaCacheLoader(java.lang.String sEntityName, java.lang.String sEntityClassName, java.lang.String sUnitName, java.lang.ClassLoader loader)
sEntityName
- the JPA name of the entitysEntityClassName
- the fully-qualified class name of the entitysUnitName
- the name of the persistence unitloader
- the ClassLoader used to load the entity classMethod Detail |
---|
public java.lang.Object load(java.lang.Object oKey)
load
in interface CacheLoader
oKey
- key whose associated value is to be returnedpublic java.util.Map loadAll(java.util.Collection colKeys)
loadAll
in interface CacheLoader
colKeys
- a collection of keys to loadprotected void initialize(java.lang.String sEntityName, java.lang.String sEntityClassName, java.lang.String sUnitName, java.lang.ClassLoader loader)
sEntityName
- the JPA name of the entitysEntityClassName
- the fully-qualified class name of the entitysUnitName
- the name of the persistence unitloader
- the ClassLoader used to load the entity classprotected javax.persistence.EntityManager getEntityManager()
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |