|
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
com.tangosol.coherence.jpa.JpaCacheStore
public class JpaCacheStore
JPA implementation of the CacheStore
interface.
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.
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(java.lang.String sEntityName, java.lang.String sEntityClassName, java.lang.String sUnitName) Constructor which accepts an entity name, class name, and persistence unit name. |
|
JpaCacheStore(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 | |
---|---|
void |
erase(java.lang.Object oKey) Remove the specified key from the underlying store if present. |
void |
eraseAll(java.util.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(java.lang.Object oKey, java.lang.Object oValue) Store the specified value under the specified key in the underlying store. |
void |
storeAll(java.util.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(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 JpaCacheStore(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 void store(java.lang.Object oKey, java.lang.Object oValue)
store
in interface CacheStore
oKey
- key to store the value underoValue
- value to be storedpublic void storeAll(java.util.Map mapEntries)
If this operation fails (by throwing an exception) after a partial success, the convention is that entries which have been stored successfully are to be removed from the specified mapEntries, indicating that the store operation for the entries left in the map has failed or has not been attempted.
storeAll
in interface CacheStore
mapEntries
- a Map of any number of keys and values to storepublic void erase(java.lang.Object oKey)
erase
in interface CacheStore
oKey
- key whose mapping is being removed from the cachepublic void eraseAll(java.util.Collection colKeys)
If this operation fails (by throwing an exception) after a partial success, the convention is that keys which have been erased successfully are to be removed from the specified colKeys, indicating that the erase operation for the keys left in the collection has failed or has not been attempted.
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.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |