|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.db.jpa.JPASupport
public class JPASupport
A super class for JPA entities
Nested Class Summary | |
---|---|
static class |
JPASupport.JPAQuery
A JPAQuery |
Field Summary | |
---|---|
boolean |
willBeSaved
|
Constructor Summary | |
---|---|
JPASupport()
|
Method Summary | ||
---|---|---|
static JPASupport.JPAQuery |
all()
Prepare a query to find *all* entities. |
|
static long |
count()
Count entities |
|
static long |
count(java.lang.String query,
java.lang.Object... params)
Count entities with a special query. |
|
static
|
create(java.lang.Class type,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.String[]> params)
|
|
static
|
create(java.lang.String name,
Scope.Params params)
|
|
|
delete()
Delete the entity. |
|
static int |
delete(java.lang.String query,
java.lang.Object... params)
Batch delete of entities |
|
static int |
deleteAll()
Delete all entities |
|
static
|
edit(java.lang.Object o,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.String[]> params)
|
|
|
edit(java.lang.String name,
Scope.Params params)
|
|
static javax.persistence.EntityManager |
em()
Retrieve the current entityManager |
|
boolean |
equals(java.lang.Object other)
JPASupport instances a and b are equals if either a == b or a and b have same id and class |
|
static JPASupport.JPAQuery |
find()
Deprecated. |
|
static JPASupport.JPAQuery |
find(java.lang.String query,
java.lang.Object... params)
Prepare a query to find entities. |
|
static
|
findAll()
Find all entities of this type |
|
static
|
findBy(java.lang.String query,
java.lang.Object... params)
Deprecated. |
|
static
|
findById(java.lang.Object id)
Find the entity with the corresponding id. |
|
static java.lang.Object |
findKey(java.lang.Object entity)
|
|
static java.lang.Class |
findKeyType(java.lang.Class c)
|
|
static
|
findOneBy(java.lang.String query,
java.lang.Object... params)
Deprecated. |
|
java.lang.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). |
|
void |
onLoad()
|
|
void |
onSave()
|
|
|
refresh()
Refresh the entity state. |
|
|
save()
store (ie insert) the entity. |
|
void |
saveAttachment()
|
|
void |
setupAttachment()
|
|
java.lang.String |
toString()
|
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(java.lang.Class type, java.lang.String name, java.util.Map<java.lang.String,java.lang.String[]> params)
public <T extends JPASupport> T edit(java.lang.String name, Scope.Params params)
public static <T extends JPASupport> T edit(java.lang.Object o, java.lang.String name, java.util.Map<java.lang.String,java.lang.String[]> params)
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(java.lang.String name, Scope.Params params)
public static long count()
public static long count(java.lang.String query, java.lang.Object... params)
query
- HQL query or shortcutparams
- Params to bind to the query
public static <T extends JPASupport> java.util.List<T> findAll()
public static <T extends JPASupport> T findById(java.lang.Object id)
id
- The entity id
public static JPASupport.JPAQuery find(java.lang.String query, java.lang.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(java.lang.String query, java.lang.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(java.lang.String query, java.lang.Object... params)
T
- query
- the parametrized query expressed in OQLparams
- parameters of the query
@Deprecated public static <T extends JPASupport> java.util.List<T> findBy(java.lang.String query, java.lang.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(java.lang.Object other)
id
and class
equals
in class java.lang.Object
other
-
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void setupAttachment()
public void saveAttachment()
public static java.lang.Object findKey(java.lang.Object entity)
public static java.lang.Class findKeyType(java.lang.Class c)
public java.lang.Object getEntityId()
public void onLoad()
public void onSave()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |