public class ActiveEntity extends Entity
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
ActiveEntity()
构造
|
ActiveEntity(Db db,
Entity entity)
构造
|
ActiveEntity(Db db,
String tableName)
构造
|
ActiveEntity(Entity entity)
构造
|
ActiveEntity(String tableName)
构造
|
| Modifier and Type | Method and Description |
|---|---|
ActiveEntity |
add()
根据Entity中现有字段条件从数据库中增加一条数据
|
ActiveEntity |
addFieldNames(String... fieldNames)
添加字段列表
|
ActiveEntity |
clone() |
static ActiveEntity |
create()
创建ActiveEntity
|
static ActiveEntity |
create(String tableName)
创建ActiveEntity
|
ActiveEntity |
del()
根据现有Entity中的条件删除与之匹配的数据库记录
|
ActiveEntity |
load()
根据Entity中现有字段条件从数据库中加载一个Entity对象
|
static <T> ActiveEntity |
parse(T bean)
将PO对象转为Entity
|
static <T> ActiveEntity |
parse(T bean,
boolean isToUnderlineCase,
boolean ignoreNullValue)
将PO对象转为ActiveEntity
|
<T> ActiveEntity |
parseBean(T bean)
将值对象转换为Entity
类名会被当作表名,小写第一个字母 |
<T> ActiveEntity |
parseBean(T bean,
boolean isToUnderlineCase,
boolean ignoreNullValue)
将值对象转换为Entity
类名会被当作表名,小写第一个字母 |
static <T> ActiveEntity |
parseWithUnderlineCase(T bean)
将PO对象转为ActiveEntity,并采用下划线法转换字段
|
ActiveEntity |
set(String field,
Object value)
设置列
|
ActiveEntity |
setFieldNames(Collection<String> fieldNames)
设置字段列表,用于限制加入的字段的值
|
ActiveEntity |
setFieldNames(String... fieldNames)
设置字段列表,用于限制加入的字段的值
|
ActiveEntity |
setFields(Func0<?>... fields)
通过lambda批量设置值
|
ActiveEntity |
setIgnoreNull(String field,
Object value)
设置列,当键或值为null时忽略
|
ActiveEntity |
setTableName(String tableName)
设置表名
|
ActiveEntity |
update(String primaryKey)
根据现有Entity中的条件删除与之匹配的数据库记录
|
addCondition, filter, getBlob, getClob, getDate, getFieldNames, getRowId, getRowId, getStr, getStr, getTableName, getTime, getTimestamp, removeNew, toStringcompute, computeIfAbsent, computeIfPresent, containsKey, customKey, 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, toBeanWithCamelCaseclear, containsValue, entrySet, forEach, keySet, removeEldestEntry, replaceAll, valuesequals, hashCodepublic ActiveEntity()
public ActiveEntity(String tableName)
tableName - 表名public ActiveEntity(Entity entity)
entity - 非动态实体public static ActiveEntity create()
public static ActiveEntity create(String tableName)
tableName - 表名public static <T> ActiveEntity parse(T bean)
T - Bean对象类型bean - Bean对象public static <T> ActiveEntity parse(T bean, boolean isToUnderlineCase, boolean ignoreNullValue)
T - Bean对象类型bean - Bean对象isToUnderlineCase - 是否转换为下划线模式ignoreNullValue - 是否忽略值为空的字段public static <T> ActiveEntity parseWithUnderlineCase(T bean)
T - Bean对象类型bean - Bean对象public ActiveEntity setTableName(String tableName)
EntitysetTableName in class EntitytableName - 表名public ActiveEntity setFieldNames(Collection<String> fieldNames)
EntitysetFieldNames in class EntityfieldNames - 字段列表public ActiveEntity setFieldNames(String... fieldNames)
EntitysetFieldNames in class EntityfieldNames - 字段列表public ActiveEntity setFields(Func0<?>... fields)
public ActiveEntity addFieldNames(String... fieldNames)
EntityaddFieldNames in class EntityfieldNames - 字段列表public <T> ActiveEntity parseBean(T bean)
Entitypublic <T> ActiveEntity parseBean(T bean, boolean isToUnderlineCase, boolean ignoreNullValue)
Entitypublic ActiveEntity set(String field, Object value)
Dictpublic ActiveEntity setIgnoreNull(String field, Object value)
DictsetIgnoreNull in class Entityfield - 属性value - 值public ActiveEntity clone()
public ActiveEntity add()
public ActiveEntity load()
public ActiveEntity del()
public ActiveEntity update(String primaryKey)
primaryKey - 主键名Copyright © 2025. All rights reserved.