Package play.db.jpa
Class GenericModel
- java.lang.Object
-
- play.db.jpa.JPABase
-
- play.db.jpa.GenericModel
-
- All Implemented Interfaces:
java.io.Serializable,Model
- Direct Known Subclasses:
Model
@MappedSuperclass public class GenericModel extends JPABase
A super class for JPA entities- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGenericModel.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
Constructors Constructor Description GenericModel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends JPABase>
Tcreate(Http.Request request, Scope.Session session, ParamNode rootParamNode, java.lang.String name, java.lang.Class<?> type, java.lang.annotation.Annotation[] annotations)Create a new model<T extends JPABase>
Tdelete()Delete the entity.<T extends GenericModel>
Tedit(Http.Request request, Scope.Session session, ParamNode rootParamNode, java.lang.String name)Edit a modelstatic <T extends JPABase>
Tedit(Http.Request request, Scope.Session session, ParamNode rootParamNode, java.lang.String name, java.lang.Object o, java.lang.annotation.Annotation[] annotations)Edit a model<T extends JPABase>
Tmerge()Merge this object to obtain a managed entity (useful when the object comes from the Cache).<T extends JPABase>
Tsave()
-
-
-
Method Detail
-
create
@Nonnull public static <T extends JPABase> T create(Http.Request request, Scope.Session session, ParamNode rootParamNode, java.lang.String name, java.lang.Class<?> type, java.lang.annotation.Annotation[] annotations)
Create a new model- Type Parameters:
T- The entity class- Parameters:
rootParamNode- parameters used to create the new objectname- name of the objecttype- the class of the objectannotations- annotations on the model- Returns:
- The created entity
-
edit
@Nonnull public static <T extends JPABase> T edit(Http.Request request, Scope.Session session, ParamNode rootParamNode, java.lang.String name, java.lang.Object o, java.lang.annotation.Annotation[] annotations)
Edit a model- Type Parameters:
T- class of the entity- Parameters:
rootParamNode- parameters used to create the new objectname- name of the objecto- the entity to updateannotations- annotations on the model- Returns:
- the entity
-
edit
@Nonnull public <T extends GenericModel> T edit(Http.Request request, Scope.Session session, ParamNode rootParamNode, java.lang.String name)
Edit a model- Type Parameters:
T- class of the entity- Parameters:
rootParamNode- parameters used to create the new objectname- name of the entity- Returns:
- the entity
-
save
@Nonnull public <T extends JPABase> T save()
-
merge
@Nonnull public <T extends JPABase> T merge()
Merge this object to obtain a managed entity (useful when the object comes from the Cache).- Type Parameters:
T- class of the entity- Returns:
- The given entity
-
delete
@Nonnull public <T extends JPABase> T delete()
Delete the entity.- Type Parameters:
T- class of the entity- Returns:
- The deleted entity.
-
-