com.adaptrex.core.persistence.jpa
Class JPAPersistenceManager
java.lang.Object
com.adaptrex.core.persistence.jpa.JPAPersistenceManager
- All Implemented Interfaces:
- AdaptrexPersistenceManager
public class JPAPersistenceManager
- extends Object
- implements AdaptrexPersistenceManager
|
Method Summary |
ModelInstance |
createModelInstance(ExtConfig extConfig,
Map<String,Object> data)
|
ModelInstance |
deleteModelInstance(ExtConfig extConfig,
Object id)
|
ModelInstance |
deleteModelInstance(ExtConfig extConfig,
String key,
Object value)
|
AdaptrexEntityType |
getAdaptrexEntity(String name)
|
Object |
getEntity(Class<?> clazz,
Object id)
Get a persistent entity based on an id for a specific class. |
Object |
getEntity(Class<?> clazz,
String key,
Object value)
Get a persistent entity based on a key value pair for a specific class. |
ModelInstance |
getModelInstance(ExtConfig extConfig,
Object id)
|
ModelInstance |
getModelInstance(ExtConfig extConfig,
String key,
Object value)
|
String |
getName()
|
Object |
getNativeSession()
Returns an EntityManager for the EntityManagerFactory this persistence manager
represents. |
AdaptrexStoreData |
getStoreData(ExtConfig extConfig)
|
void |
shutdown()
Shuts down the EntityManagerFactory this persistence manager uses to generate its
ObjectContexts. |
ModelInstance |
updateModelInstance(ExtConfig extConfig,
Object id,
Map<String,Object> data)
|
ModelInstance |
updateModelInstance(ExtConfig extConfig,
String key,
Object value,
Map<String,Object> data)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JPAPersistenceManager
public JPAPersistenceManager(String factoryName)
throws IOException
- Throws:
IOException
JPAPersistenceManager
public JPAPersistenceManager(javax.persistence.EntityManagerFactory emf)
JPAPersistenceManager
public JPAPersistenceManager(javax.persistence.EntityManagerFactory emf,
String factoryName)
getAdaptrexEntity
public AdaptrexEntityType getAdaptrexEntity(String name)
- Specified by:
getAdaptrexEntity in interface AdaptrexPersistenceManager
getName
public String getName()
- Specified by:
getName in interface AdaptrexPersistenceManager
getNativeSession
public Object getNativeSession()
- Returns an EntityManager for the EntityManagerFactory this persistence manager
represents.
- Specified by:
getNativeSession in interface AdaptrexPersistenceManager
shutdown
public void shutdown()
- Shuts down the EntityManagerFactory this persistence manager uses to generate its
ObjectContexts. This should be called to clean up Cayenne when the container
is shut down.
- Specified by:
shutdown in interface AdaptrexPersistenceManager
getEntity
public Object getEntity(Class<?> clazz,
Object id)
- Get a persistent entity based on an id for a specific class.
- Specified by:
getEntity in interface AdaptrexPersistenceManager
getEntity
public Object getEntity(Class<?> clazz,
String key,
Object value)
- Get a persistent entity based on a key value pair for a specific class.
- Specified by:
getEntity in interface AdaptrexPersistenceManager
getStoreData
public AdaptrexStoreData getStoreData(ExtConfig extConfig)
- Specified by:
getStoreData in interface AdaptrexPersistenceManager
getModelInstance
public ModelInstance getModelInstance(ExtConfig extConfig,
Object id)
- Specified by:
getModelInstance in interface AdaptrexPersistenceManager
getModelInstance
public ModelInstance getModelInstance(ExtConfig extConfig,
String key,
Object value)
- Specified by:
getModelInstance in interface AdaptrexPersistenceManager
createModelInstance
public ModelInstance createModelInstance(ExtConfig extConfig,
Map<String,Object> data)
- Specified by:
createModelInstance in interface AdaptrexPersistenceManager
updateModelInstance
public ModelInstance updateModelInstance(ExtConfig extConfig,
Object id,
Map<String,Object> data)
throws Exception
- Specified by:
updateModelInstance in interface AdaptrexPersistenceManager
- Throws:
Exception
updateModelInstance
public ModelInstance updateModelInstance(ExtConfig extConfig,
String key,
Object value,
Map<String,Object> data)
throws Exception
- Specified by:
updateModelInstance in interface AdaptrexPersistenceManager
- Throws:
Exception
deleteModelInstance
public ModelInstance deleteModelInstance(ExtConfig extConfig,
Object id)
- Specified by:
deleteModelInstance in interface AdaptrexPersistenceManager
deleteModelInstance
public ModelInstance deleteModelInstance(ExtConfig extConfig,
String key,
Object value)
- Specified by:
deleteModelInstance in interface AdaptrexPersistenceManager
Copyright © 2012 Adaptrex, LLC. All Rights Reserved.