|
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
com.tangosol.coherence.jpa.JpaCacheStore
public class JpaCacheStore
JPA implementation of the CacheStore
interface. <p/> Use this class as a full load and store implementation that uses any JPA implementation to load and store entities to and from a data store. The entities must be mapped to the data store and a JPA persistence unit configuration must exist. <p/> NOTE: The persistence unit is assumed to be set to use RESOURCE_LOCAL transactions.
Field Summary |
---|
Fields inherited from class com.tangosol.coherence.jpa.JpaCacheLoader |
---|
m_emf, m_sEntityClass, m_sEntityName, s_mapFactories |
Constructor Summary | |
---|---|
JpaCacheStore(String sEntityName, String sEntityClassName, String sUnitName) Constructor which accepts an entity name, class name, and persistence unit name. |
|
JpaCacheStore(String sEntityName, String sEntityClassName, String sUnitName, ClassLoader loader) Constructor which accepts an entity name, class name, persistence unit name, and classloader. |
Method Summary | |
---|---|
void |
erase(Object oKey) Remove the specified key from the underlying store if present. |
void |
eraseAll(Collection colKeys) Remove the specified keys from the underlying store if present. |
protected void |
rollback(javax.persistence.EntityTransaction tx) Rollback the given EntityTransaction if it is not null and is active. |
void |
store(Object oKey, Object oValue) Store the specified value under the specified key in the underlying store. |
void |
storeAll(Map mapEntries) Store the specified values under the specified keys in the underlying store. |
Methods inherited from class com.tangosol.coherence.jpa.JpaCacheLoader |
---|
getEntityManager, initialize, load, loadAll |
Methods inherited from interface com.tangosol.net.cache.CacheLoader |
---|
load, loadAll |
Constructor Detail |
---|
public JpaCacheStore(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 JpaCacheStore(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 void store(Object oKey, Object oValue)
store
in interface CacheStore
oKey
- key to store the value underoValue
- value to be storedpublic void storeAll(Map mapEntries)
storeAll
in interface CacheStore
mapEntries
- a Map of any number of keys and values to storepublic void erase(Object oKey)
erase
in interface CacheStore
oKey
- key whose mapping is being removed from the cachepublic void eraseAll(Collection colKeys)
eraseAll
in interface CacheStore
colKeys
- keys whose mappings are being removed from the cacheprotected void rollback(javax.persistence.EntityTransaction tx)
tx
- the EntityTransaction; may be null
|
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 |