public class Entity extends Dict
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
Entity() |
Entity(String tableName)
构造
|
Entity(String tableName,
boolean caseInsensitive)
构造
|
Modifier and Type | Method and Description |
---|---|
Entity |
addFieldNames(String... fieldNames)
添加字段列表
|
Entity |
clone() |
static Entity |
create()
创建Entity
|
static Entity |
create(String tableName)
创建Entity
|
Entity |
filter(String... keys)
过滤Map保留指定键值对,如果键不存在跳过
|
Blob |
getBlob(String field)
获得Blob类型结果
|
Clob |
getClob(String field)
获得Clob类型结果
|
Date |
getDate(String field)
获取Date类型值
|
Set<String> |
getFieldNames() |
RowId |
getRowId()
获得rowid
|
RowId |
getRowId(String field)
获得rowid
|
String |
getStr(String field)
获取字符串型属性值
|
String |
getStr(String field,
Charset charset)
获得字符串值
支持Clob、Blob、RowId |
String |
getTableName() |
Time |
getTime(String field) |
Timestamp |
getTimestamp(String field) |
static <T> Entity |
parse(T bean)
将PO对象转为Entity
|
static <T> Entity |
parse(T bean,
boolean isToUnderlineCase,
boolean ignoreNullValue)
将PO对象转为Entity
|
<T> Entity |
parseBean(T bean)
将值对象转换为Entity
类名会被当作表名,小写第一个字母 |
<T> Entity |
parseBean(T bean,
boolean isToUnderlineCase,
boolean ignoreNullValue)
将值对象转换为Entity
类名会被当作表名,小写第一个字母 |
static <T> Entity |
parseWithUnderlineCase(T bean)
将PO对象转为Entity,并采用下划线法转换字段
|
Entity |
removeNew(String... keys)
过滤Map去除指定键值对,如果键不存在跳过
|
Entity |
set(String field,
Object value)
设置列
|
Entity |
setFieldNames(Collection<String> fieldNames)
设置字段列表,用于限制加入的字段的值
|
Entity |
setFieldNames(String... fieldNames)
设置字段列表,用于限制加入的字段的值
|
Entity |
setFields(Func0<?>... fields)
通过lambda批量设置值
|
Entity |
setIgnoreNull(String field,
Object value)
设置列,当键或值为null时忽略
|
Entity |
setTableName(String tableName)
设置表名
|
String |
toString() |
compute, computeIfAbsent, computeIfPresent, containsKey, get, get, getBean, getBigDecimal, getBigInteger, getBool, getByPath, getByPath, getByte, getBytes, getChar, getDouble, getEnum, getFloat, getInt, getLong, getNumber, getObj, getOrDefault, getShort, merge, of, of, put, putAll, putIfAbsent, remove, remove, removeEqual, replace, replace, toBean, toBean, toBean, toBeanIgnoreCase, toBeanIgnoreCase, toBeanWithCamelCase
clear, containsValue, entrySet, forEach, keySet, removeEldestEntry, replaceAll, values
equals, hashCode
public Entity()
public Entity(String tableName)
tableName
- 数据表名public Entity(String tableName, boolean caseInsensitive)
tableName
- 数据表名caseInsensitive
- 是否大小写不敏感public static Entity create()
public static Entity create(String tableName)
tableName
- 表名public static <T> Entity parse(T bean)
T
- Bean对象类型bean
- Bean对象public static <T> Entity parse(T bean, boolean isToUnderlineCase, boolean ignoreNullValue)
T
- Bean对象类型bean
- Bean对象isToUnderlineCase
- 是否转换为下划线模式ignoreNullValue
- 是否忽略值为空的字段public static <T> Entity parseWithUnderlineCase(T bean)
T
- Bean对象类型bean
- Bean对象public String getTableName()
public Entity setTableName(String tableName)
tableName
- 表名public Entity setFieldNames(Collection<String> fieldNames)
fieldNames
- 字段列表public Entity setFieldNames(String... fieldNames)
fieldNames
- 字段列表public Entity addFieldNames(String... fieldNames)
fieldNames
- 字段列表public <T> Entity parseBean(T bean)
public <T> Entity parseBean(T bean, boolean isToUnderlineCase, boolean ignoreNullValue)
public Entity removeNew(String... keys)
keys
- 键列表public Entity setIgnoreNull(String field, Object value)
Dict
setIgnoreNull
in class Dict
field
- 属性value
- 值public Blob getBlob(String field)
field
- 参数public Date getDate(String field)
BasicTypeGetter
getDate
in interface BasicTypeGetter<String>
getDate
in class Dict
field
- 字段名public Timestamp getTimestamp(String field)
getTimestamp
in class Dict
field
- 字段名public String getStr(String field)
BasicTypeGetter
getStr
in interface BasicTypeGetter<String>
getStr
in class Dict
field
- 字段名public String getStr(String field, Charset charset)
field
- 字段名charset
- 编码public RowId getRowId()
public String toString()
toString
in class AbstractMap<String,Object>
Copyright © 2024. All rights reserved.