|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.adaptrex.core.persistence.jpa.JpaPersistence
public class JpaPersistence
| Constructor Summary | |
|---|---|
JpaPersistence(javax.persistence.EntityManagerFactory factory)
|
|
| Method Summary | |
|---|---|
void |
closeNativeSession(Object entityManager)
|
Object |
deleteEntity(AdaptrexSession session,
Object entity)
This should delete an entity from the default persistence unit based on the supplied className and id |
Object |
getEntity(AdaptrexSession session,
Class<?> clazz,
Integer id)
This should return a single entity object from the default persistence unit based on the supplied class and id |
Object |
getEntity(AdaptrexSession session,
String entityName,
Integer id)
This should return a single entity object from the default persistence unit based on the supplied className and id |
Class<?> |
getEntityClass(String className)
This should return the class for a specific className in the default persistence unit (JPA Persistence Unit, Hibernate session, etc, etc). |
List<Object> |
getEntityList(AdaptrexSession session,
Store store)
This should return a list of objects that comprise the data that is to be included in an ext.data.Store. |
Object |
getFactory()
|
String |
getFieldType(Class<?> clazz,
String fieldName)
|
Object |
getFieldValue(Object entity,
String fieldName)
|
Object |
getNativeSession()
This should return the default session entity manager for whichever implementation is being used. |
boolean |
isIdField(Class<?> clazz,
String fieldName)
|
boolean |
isManyToOne(Class<?> clazz,
String fieldName)
|
boolean |
isOneToMany(Class<?> clazz,
String fieldName)
|
Object |
saveEntity(AdaptrexSession session,
Object entity)
This should save (create or update) the supplied entity using the default persistence unit and return an updated instance of the entity |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JpaPersistence(javax.persistence.EntityManagerFactory factory)
| Method Detail |
|---|
public Class<?> getEntityClass(String className)
AdaptrexPersistence
getEntityClass in interface AdaptrexPersistence
public Object getEntity(AdaptrexSession session,
String entityName,
Integer id)
AdaptrexPersistence
getEntity in interface AdaptrexPersistence
public Object getEntity(AdaptrexSession session,
Class<?> clazz,
Integer id)
AdaptrexPersistence
getEntity in interface AdaptrexPersistence
public Object saveEntity(AdaptrexSession session,
Object entity)
AdaptrexPersistence
saveEntity in interface AdaptrexPersistence
public Object deleteEntity(AdaptrexSession session,
Object entity)
AdaptrexPersistence
deleteEntity in interface AdaptrexPersistence
public List<Object> getEntityList(AdaptrexSession session,
Store store)
AdaptrexPersistence
getEntityList in interface AdaptrexPersistence
public boolean isIdField(Class<?> clazz,
String fieldName)
isIdField in interface AdaptrexPersistence
public boolean isOneToMany(Class<?> clazz,
String fieldName)
isOneToMany in interface AdaptrexPersistence
public boolean isManyToOne(Class<?> clazz,
String fieldName)
isManyToOne in interface AdaptrexPersistence
public Object getFieldValue(Object entity,
String fieldName)
getFieldValue in interface AdaptrexPersistence
public String getFieldType(Class<?> clazz,
String fieldName)
getFieldType in interface AdaptrexPersistencepublic Object getFactory()
getFactory in interface AdaptrexPersistencepublic Object getNativeSession()
AdaptrexPersistence
getNativeSession in interface AdaptrexPersistencepublic void closeNativeSession(Object entityManager)
closeNativeSession in interface AdaptrexPersistence
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||