|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.db.jpa.JPABase play.db.jpa.GenericModel
@MappedSuperclass public class GenericModel
A super class for JPA entities
Nested Class Summary | |
---|---|
static class |
GenericModel.JPAQuery
A JPAQuery |
Nested classes/interfaces inherited from class play.db.jpa.JPABase |
---|
JPABase.JPAQueryException |
Nested classes/interfaces inherited from interface play.db.Model |
---|
Model.BinaryField, Model.Choices, Model.Factory, Model.Manager, Model.Property |
Field Summary |
---|
Fields inherited from class play.db.jpa.JPABase |
---|
willBeSaved |
Constructor Summary | |
---|---|
GenericModel()
|
Method Summary | ||
---|---|---|
void |
_saveAttachment()
|
|
void |
_setupAttachment()
|
|
static GenericModel.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. |
|
boolean |
create()
store (ie insert) the entity. |
|
static
|
create(java.lang.Class<?> type,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.String[]> params,
java.lang.annotation.Annotation[] annotations)
|
|
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,
java.lang.annotation.Annotation[] annotations)
|
|
|
edit(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String[]> params)
|
|
static GenericModel.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
|
findById(java.lang.Object id)
Find the entity with the corresponding id. |
|
|
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. |
|
boolean |
validateAndCreate()
|
|
boolean |
validateAndSave()
|
Methods inherited from class play.db.jpa.JPABase |
---|
_delete, _key, _save, em, equals, getEntityId, hashCode, isPersistent, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GenericModel()
Method Detail |
---|
public static <T extends JPABase> T create(java.lang.Class<?> type, java.lang.String name, java.util.Map<java.lang.String,java.lang.String[]> params, java.lang.annotation.Annotation[] annotations)
public static <T extends JPABase> T edit(java.lang.Object o, java.lang.String name, java.util.Map<java.lang.String,java.lang.String[]> params, java.lang.annotation.Annotation[] annotations)
public <T extends GenericModel> T edit(java.lang.String name, java.util.Map<java.lang.String,java.lang.String[]> params)
public boolean validateAndSave()
public boolean validateAndCreate()
public <T extends JPABase> T save()
public boolean create()
public <T extends JPABase> T refresh()
public <T extends JPABase> T merge()
public <T extends JPABase> T delete()
public static <T extends JPABase> 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 JPABase> java.util.List<T> findAll()
public static <T extends JPABase> T findById(java.lang.Object id)
id
- The entity id
public static GenericModel.JPAQuery find(java.lang.String query, java.lang.Object... params)
query
- HQL query or shortcutparams
- Params to bind to the query
public static GenericModel.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()
public void _setupAttachment()
public void _saveAttachment()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |