|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectplay.db.jpa.JPASupport
public class JPASupport
A super class for JPA entities
| Nested Class Summary | |
|---|---|
static class |
JPASupport.JPAQuery
A JPAQuery |
static class |
JPASupport.JPAQueryException
|
| Field Summary | |
|---|---|
boolean |
willBeSaved
|
| Constructor Summary | |
|---|---|
JPASupport()
|
|
| Method Summary | ||
|---|---|---|
void |
afterLoad()
|
|
void |
afterSave()
|
|
static JPASupport.JPAQuery |
all()
Prepare a query to find *all* entities. |
|
static long |
count()
Count entities |
|
static long |
count(String query,
Object... params)
Count entities with a special query. |
|
static
|
create(Class type,
String name,
Map<String,String[]> params)
|
|
static
|
create(String name,
Scope.Params params)
|
|
|
delete()
Delete the entity. |
|
static int |
delete(String query,
Object... params)
Batch delete of entities |
|
static int |
deleteAll()
Delete all entities |
|
static
|
edit(Object o,
String name,
Map<String,String[]> params)
|
|
|
edit(String name,
Scope.Params params)
|
|
static javax.persistence.EntityManager |
em()
Retrieve the current entityManager |
|
boolean |
equals(Object other)
JPASupport instances a and b are equals if either a == b or a and b have same key and class |
|
static JPASupport.JPAQuery |
find()
Deprecated. |
|
static JPASupport.JPAQuery |
find(String query,
Object... params)
Prepare a query to find entities. |
|
static
|
findAll()
Find all entities of this type |
|
static
|
findBy(String query,
Object... params)
Deprecated. |
|
static
|
findById(Object id)
Find the entity with the corresponding id. |
|
static Object |
findKey(Object entity)
|
|
static Class |
findKeyType(Class c)
|
|
static
|
findOneBy(String query,
Object... params)
Deprecated. |
|
Object |
getEntityId()
|
|
static javax.persistence.EntityManager |
getEntityManager()
Deprecated. |
|
int |
hashCode()
|
|
|
merge()
Merge this object to obtain a managed entity (usefull when the object comes from the Cache). |
|
|
refresh()
Refresh the entity state. |
|
|
save()
store (ie insert) the entity. |
|
void |
saveAttachment()
|
|
void |
setupAttachment()
|
|
String |
toString()
|
|
boolean |
validateAndSave()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public transient boolean willBeSaved
| Constructor Detail |
|---|
public JPASupport()
| Method Detail |
|---|
public static <T extends JPASupport> T create(Class type,
String name,
Map<String,String[]> params)
public <T extends JPASupport> T edit(String name,
Scope.Params params)
public static <T extends JPASupport> T edit(Object o,
String name,
Map<String,String[]> params)
public boolean validateAndSave()
public <T extends JPASupport> T save()
public <T extends JPASupport> T refresh()
public <T extends JPASupport> T merge()
public <T extends JPASupport> T delete()
public static <T extends JPASupport> T create(String name,
Scope.Params params)
public static long count()
public static long count(String query,
Object... params)
query - HQL query or shortcutparams - Params to bind to the query
public static <T extends JPASupport> List<T> findAll()
public static <T extends JPASupport> T findById(Object id)
id - The entity id
public static JPASupport.JPAQuery find(String query,
Object... params)
query - HQL query or shortcutparams - Params to bind to the query
@Deprecated public static JPASupport.JPAQuery find()
public static JPASupport.JPAQuery all()
public static int delete(String query,
Object... params)
query - HQL query or shortcutparams - Params to bind to the query
public static int deleteAll()
@Deprecated
public static <T extends JPASupport> T findOneBy(String query,
Object... params)
T - query - the parametrized query expressed in OQLparams - parameters of the query
@Deprecated
public static <T extends JPASupport> List<T> findBy(String query,
Object... params)
T - query - the parametrized query expressed in OQLparams - parameters of the query
public static javax.persistence.EntityManager em()
@Deprecated public static javax.persistence.EntityManager getEntityManager()
public boolean equals(Object other)
key and class
equals in class Objectother -
public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic void setupAttachment()
public void saveAttachment()
public static Object findKey(Object entity)
public static Class findKeyType(Class c)
public Object getEntityId()
public void afterLoad()
public void afterSave()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||