|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcn.dreampie.common.entity.Entity<M>
public abstract class Entity<M extends Entity>
Created by ice on 14-12-31.
| 构造方法摘要 | |
|---|---|
Entity()
|
|
| 方法摘要 | ||
|---|---|---|
boolean |
checkMethod()
check method for to json |
|
M |
clearAttrs()
Remove all attrs of this entity. |
|
M |
clearModifyAttrs()
|
|
|
get(String attr)
Get attr of any sql type |
|
|
get(String attr,
Class<T> clazz)
Parse attr to any type |
|
|
get(String attr,
Class<T> clazz,
Object defaultValue)
Get attr for clazz. |
|
|
get(String attr,
Object defaultValue)
Get attr of any sql type. |
|
String[] |
getAttrNames()
Return attr name of this record. |
|
Map<String,Object> |
getAttrs()
Return attribute Map. |
|
Object[] |
getAttrValues()
Return attr values of this record. |
|
abstract Class |
getColumnType(String attr)
获取改数据库列对应的java类型 |
|
String[] |
getModifyAttrNames()
Return attribute name of this entity. |
|
Map<String,Object> |
getModifyAttrs()
获取更新的属性列表 |
|
Object[] |
getModifyAttrValues()
Return attribute values of this entity. |
|
abstract boolean |
hasColumn(String attr)
判断数据库是否拥有该列 |
|
M |
init(String attr,
Object value)
初始化属性 不会添加到modify |
|
M |
initAttrs(M entity)
|
|
M |
initAttrs(Map<String,Object> attrs)
|
|
M |
keep(String... attrs)
Keep attrs of this entity and remove other attrs. |
|
M |
keep(String attr)
Keep attr of this entity and remove other attrs. |
|
M |
put(String attr,
Object value)
Put key value pair to the entity when the key is not attribute of the entity. |
|
M |
putAttrs(M entity)
Set attrs value with entity. |
|
M |
putAttrs(Map<String,Object> attrs)
|
|
M |
remove(String... attrs)
Remove attrs of this entity. |
|
M |
remove(String attr)
Remove attribute of this entity. |
|
M |
removeNull()
Remove attrs if it is null. |
|
M |
reSetAttrs(Map<String,Object> attrs)
|
|
M |
reSetModifyAttrs(Map<String,Object> modifyAttrs)
|
|
M |
set(String attr,
Object value)
Set attribute to entity. |
|
M |
setAttrs(M entity)
Set attributes with other entity. |
|
M |
setAttrs(Map<String,Object> attrs)
Set attributes with Map. |
|
String |
toJson()
Return json string of this record. |
|
String |
toString()
|
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 构造方法详细信息 |
|---|
public Entity()
| 方法详细信息 |
|---|
public Map<String,Object> getAttrs()
public M setAttrs(M entity)
entity - the Model
public M setAttrs(Map<String,Object> attrs)
attrs - attributes of this entity
public Map<String,Object> getModifyAttrs()
public boolean checkMethod()
public abstract boolean hasColumn(String attr)
attr - 属性名
public abstract Class getColumnType(String attr)
attr - 属性名
public M set(String attr,
Object value)
attr - the attribute name of the entityvalue - the value of the attribute
EntityException - if the attribute is not exists of the entity
public M init(String attr,
Object value)
attr - value -
public M initAttrs(Map<String,Object> attrs)
public M initAttrs(M entity)
public M put(String attr,
Object value)
attr - 属性名称value - 属性值
public M putAttrs(Map<String,Object> attrs)
public M putAttrs(M entity)
entity - the entitypublic <T> T get(String attr)
public <T> T get(String attr,
Class<T> clazz)
public <T> T get(String attr,
Object defaultValue)
public <T> T get(String attr,
Class<T> clazz,
Object defaultValue)
public M remove(String attr)
attr - the attr name of the entitypublic M remove(String... attrs)
attrs - the attr name of the entitypublic M removeNull()
public M keep(String... attrs)
attrs - the attr name of the entitypublic M keep(String attr)
attr - the attr name of the entitypublic M clearAttrs()
public M clearModifyAttrs()
public M reSetAttrs(Map<String,Object> attrs)
public M reSetModifyAttrs(Map<String,Object> modifyAttrs)
public String[] getAttrNames()
public Object[] getAttrValues()
public String[] getModifyAttrNames()
public Object[] getModifyAttrValues()
public String toString()
Object 中的 toStringpublic String toJson()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||