play.db.jpa
类 GenericModel

java.lang.Object
  继承者 play.db.jpa.JPABase
      继承者 play.db.jpa.GenericModel
所有已实现的接口:
java.io.Serializable, Model
直接已知子类:
JPASupport, Model

@MappedSuperclass
public class GenericModel
extends JPABase

A super class for JPA entities

另请参见:
序列化表格

嵌套类摘要
static class GenericModel.JPAQuery
          A JPAQuery
 
从类 play.db.jpa.JPABase 继承的嵌套类/接口
JPABase.JPAQueryException
 
从接口 play.db.Model 继承的嵌套类/接口
Model.BinaryField, Model.Choices, Model.Factory, Model.Manager, Model.Property
 
字段摘要
 
从类 play.db.jpa.JPABase 继承的字段
willBeSaved
 
构造方法摘要
GenericModel()
           
 
方法摘要
 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
<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)
          已过时。 
static
<T extends JPABase>
T
create(ParamNode rootParamNode, java.lang.String name, java.lang.Class<?> type, java.lang.annotation.Annotation[] annotations)
           
static
<T extends JPABase>
T
create(java.lang.String name, Scope.Params params)
           
<T extends JPABase>
T
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
<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)
          已过时。 
<T extends GenericModel>
T
edit(ParamNode rootParamNode, java.lang.String name)
           
static
<T extends JPABase>
T
edit(ParamNode rootParamNode, java.lang.String name, java.lang.Object o, java.lang.annotation.Annotation[] annotations)
           
<T extends GenericModel>
T
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
<T extends JPABase>
java.util.List<T>
findAll()
          Find all entities of this type
static
<T extends JPABase>
T
findById(java.lang.Object id)
          Find the entity with the corresponding id.
<T extends JPABase>
T
merge()
          Merge this object to obtain a managed entity (usefull when the object comes from the Cache).
<T extends JPABase>
T
refresh()
          Refresh the entity state.
<T extends JPABase>
T
save()
          store (ie insert) the entity.
 boolean validateAndCreate()
           
 boolean validateAndSave()
           
 
从类 play.db.jpa.JPABase 继承的方法
_delete, _key, _save, em, equals, getEntityId, getJPAConfig, getJPAContext, hashCode, isPersistent, toString
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

GenericModel

public GenericModel()
方法详细信息

create

@Deprecated
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)
已过时。 

This method is deprecated. Use this instead: public static T create(ParamNode rootParamNode, String name, Class type, Annotation[] annotations)


create

public static <T extends JPABase> T create(ParamNode rootParamNode,
                                           java.lang.String name,
                                           java.lang.Class<?> type,
                                           java.lang.annotation.Annotation[] annotations)

edit

@Deprecated
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)
已过时。 

This method is deprecated. Use this instead: public static T edit(ParamNode rootParamNode, String name, Object o, Annotation[] annotations)

返回:

edit

public static <T extends JPABase> T edit(ParamNode rootParamNode,
                                         java.lang.String name,
                                         java.lang.Object o,
                                         java.lang.annotation.Annotation[] annotations)

edit

@Deprecated
public <T extends GenericModel> T edit(java.lang.String name,
                                                  java.util.Map<java.lang.String,java.lang.String[]> params)
已过时。 

This method is deprecated. Use this instead: public T edit(ParamNode rootParamNode, String name)


edit

public <T extends GenericModel> T edit(ParamNode rootParamNode,
                                       java.lang.String name)

validateAndSave

public boolean validateAndSave()

validateAndCreate

public boolean validateAndCreate()

save

public <T extends JPABase> T save()
store (ie insert) the entity.


create

public boolean create()
store (ie insert) the entity.


refresh

public <T extends JPABase> T refresh()
Refresh the entity state.


merge

public <T extends JPABase> T merge()
Merge this object to obtain a managed entity (usefull when the object comes from the Cache).


delete

public <T extends JPABase> T delete()
Delete the entity.

返回:
The deleted entity.

create

public static <T extends JPABase> T create(java.lang.String name,
                                           Scope.Params params)

count

public static long count()
Count entities

返回:
number of entities of this class

count

public static long count(java.lang.String query,
                         java.lang.Object... params)
Count entities with a special query. Example : Long moderatedPosts = Post.count("moderated", true);

参数:
query - HQL query or shortcut
params - Params to bind to the query
返回:
A long

findAll

public static <T extends JPABase> java.util.List<T> findAll()
Find all entities of this type


findById

public static <T extends JPABase> T findById(java.lang.Object id)
Find the entity with the corresponding id.

参数:
id - The entity id
返回:
The entity

find

public static GenericModel.JPAQuery find(java.lang.String query,
                                         java.lang.Object... params)
Prepare a query to find entities.

参数:
query - HQL query or shortcut
params - Params to bind to the query
返回:
A JPAQuery

all

public static GenericModel.JPAQuery all()
Prepare a query to find *all* entities.

返回:
A JPAQuery

delete

public static int delete(java.lang.String query,
                         java.lang.Object... params)
Batch delete of entities

参数:
query - HQL query or shortcut
params - Params to bind to the query
返回:
Number of entities deleted

deleteAll

public static int deleteAll()
Delete all entities

返回:
Number of entities deleted

_setupAttachment

public void _setupAttachment()

_saveAttachment

public void _saveAttachment()


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly