|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AdaptrexPersistence
AdaptrexPersistence provides an interface to an variety of implementations that
handle persistence between Adaptrex and an ORM. Currently only a standard JPA2
(via EclipseLink) implentation is included but he eventual goal is to allow nearly
any ORM to be supported (Hibernate, Cayanne, TopLink, OpenJpa, etc, etc).
Some of the code in adaptrex-core that uses this API is currently JPA specific.
com.adaptrex.core.ext.data.ModelInstance scans its target entity several times and
reads JPA annotations to determine things like join types and the type of objects
being retrieved. The AdaptrexPersistence interface should be made much more robust
to handle this functionality and current functionality should move to the JPA specific
implementation.
Because this API is not yet 100% stable, it should only be used inside other adaptrex-core code
| Method Summary | |
|---|---|
Object |
deleteEntity(String className,
Integer id)
This should delete an entity from the default persistence unit based on the supplied className and id |
Object |
getEntity(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(String className,
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(Store store)
This should return a list of objects that comprise the data that is to be included in an ext.data.Store. |
Object |
getEntityManager()
This should return the default entity manager for whichever implementation is being used. |
Object |
getFieldValue(Object entity,
String fieldName)
|
boolean |
isIdField(Class<?> clazz,
String fieldName)
|
boolean |
isManyToOne(Class<?> clazz,
String fieldName)
|
boolean |
isOneToMany(Class<?> clazz,
String fieldName)
|
Object |
saveEntity(Object entity)
This should save (create or update) the supplied entity using the default persistence unit and return an updated instance of the entity |
void |
shutdown()
|
| Method Detail |
|---|
Class<?> getEntityClass(String className)
className -
List<Object> getEntityList(Store store)
store -
Object getEntity(String className,
Integer id)
className - id -
Object getEntity(Class<?> clazz,
Integer id)
class - id -
Object saveEntity(Object entity)
entity -
Object deleteEntity(String className,
Integer id)
className - id -
Object getEntityManager()
void shutdown()
boolean isIdField(Class<?> clazz,
String fieldName)
boolean isOneToMany(Class<?> clazz,
String fieldName)
boolean isManyToOne(Class<?> clazz,
String fieldName)
Object getFieldValue(Object entity,
String fieldName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||