|
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.jpa.JpaCacheLoader
public class JpaCacheLoader
JPA implementation of the CacheLoader
interface. <p/> 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. <p/> 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 Class |
m_sEntityClass The entity class that this CacheLoader is managing. |
protected String |
m_sEntityName Name of the entity that this CacheLoader is managing. |
protected static Map |
s_mapFactories Map of all shared entity manager factories for all persistence units. |
Constructor Summary | |
---|---|
JpaCacheLoader(String sEntityName, String sEntityClassName, String sUnitName) Constructor which accepts an entity name, class name, and persistence unit name. |
|
JpaCacheLoader(String sEntityName, String sEntityClassName, String sUnitName, 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(String sEntityName, String sEntityClassName, String sUnitName, ClassLoader loader) Initialize this 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. |
Field Detail |
---|
protected static final Map s_mapFactories
protected String m_sEntityName
protected Class m_sEntityClass
protected javax.persistence.EntityManagerFactory m_emf
Constructor Detail |
---|
public JpaCacheLoader(String sEntityName, String sEntityClassName, String sUnitName)
sEntityName
- the JPA name of the entitysEntityClassName
- the fully-qualified class name of the entitysUnitName
- the name of the persistence unitpublic JpaCacheLoader(String sEntityName, String sEntityClassName, String sUnitName, 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 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 sEntityClassName, String sUnitName, 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.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |