Package play.db.jpa
Class GenericModel
java.lang.Object
play.db.jpa.JPABase
play.db.jpa.GenericModel
- All Implemented Interfaces:
Serializable
,Model
- Direct Known Subclasses:
Model
A super class for JPA entities
- See Also:
-
Nested Class Summary
Nested ClassesNested 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends JPABase>
Tcreate
(Http.Request request, Scope.Session session, ParamNode rootParamNode, String name, Class<?> type, 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, String name) Edit a modelstatic <T extends JPABase>
Tedit
(Http.Request request, Scope.Session session, ParamNode rootParamNode, String name, Object o, 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()
-
Constructor Details
-
GenericModel
public GenericModel()
-
-
Method Details
-
create
@Nonnull public static <T extends JPABase> T create(Http.Request request, Scope.Session session, ParamNode rootParamNode, String name, Class<?> type, 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, String name, Object o, 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, 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
-
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
Delete the entity.- Type Parameters:
T
- class of the entity- Returns:
- The deleted entity.
-