public final class Model extends Object
Model class.
| Modifier and Type | Field and Description |
|---|---|
static DefaultModelMeta |
meta |
static String |
NULL
Constant
NULL="null" |
| Modifier and Type | Method and Description |
|---|---|
static String |
getEntityName(Object obj)
getEntityName.
|
static Populator |
getPopulator() |
static EntityType |
getType(Class<?> clazz)
getEntityType.
|
static EntityType |
getType(String entityName)
getEntityType.
|
static <T extends Entity<?>> |
newInstance(Class<T> clazz)
newInstance.
|
static <T extends Entity<ID>,ID extends Serializable> |
newInstance(Class<T> clazz,
ID id)
newInstance.
|
static void |
populate(Object entity,
Map<String,Object> params)
将params中的属性([attr(string)->value(object)],放入到实体类中。
如果引用到了别的实体,那么 如果params中的id为null,则将该实体的置为null. 否则新生成一个实体,将其id设为params中指定的值。 空字符串按照null处理 |
static void |
setMeta(DefaultModelMeta meta) |
public static final String NULL
NULL="null"public static DefaultModelMeta meta
public static <T extends Entity<?>> T newInstance(Class<T> clazz)
newInstance.
T - a T object.clazz - public static <T extends Entity<ID>,ID extends Serializable> T newInstance(Class<T> clazz, ID id)
newInstance.
public static EntityType getType(String entityName)
getEntityType.
entityName - a String object.EntityType object.public static EntityType getType(Class<?> clazz)
getEntityType.
clazz - a Class object.EntityType object.public static void populate(Object entity, Map<String,Object> params)
public static Populator getPopulator()
public static void setMeta(DefaultModelMeta meta)
Copyright © 2005–2018 The Beangle Software. All rights reserved.