T - 对象类型public class SimpleORM<T>
extends java.lang.Object
简单对象记录映射.
| 构造器和说明 |
|---|
SimpleORM(java.lang.Class<T> type,
org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) |
SimpleORM(java.lang.Class<T> type,
org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
java.lang.String dataBase) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
delete(T entity)
删除.
|
T |
get(java.io.Serializable id)
获取指定的对象.
|
cn.featherfly.common.db.data.Execution |
getDeleteExecution(T entity)
返回删除对象的Execution.
|
cn.featherfly.common.db.data.Execution |
getGetExecution(java.io.Serializable id)
返回获取指定对象的Execution.
|
java.io.Serializable |
getIdentity(T entity)
返回唯一标示值
|
cn.featherfly.common.db.data.Execution |
getQueryExecution(cn.featherfly.common.db.builder.ConditionBuilder conditionBuilder)
根据指定条件返回Execution.
|
cn.featherfly.common.db.data.Execution |
getSaveExecution(T entity)
返回保存对象的Execution.
|
cn.featherfly.common.db.data.Execution |
getUpdateExecution(T entity)
返回更新对象的Execution.
|
boolean |
isGeneratedKey() |
java.util.List<T> |
list(cn.featherfly.common.db.builder.ConditionBuilder conditionBuilder)
根据指定条件返回查询结果集合.
|
java.util.List<T> |
list(java.lang.String condition,
java.lang.Object... params)
根据指定条件返回查询结果集合.
|
T |
load(T entity)
加载对象.
|
void |
merge(T entity)
合并操作,将传入对象的非空字段更新进数据库(忽略null).
|
int |
save(T entity)
保存.
|
void |
setGeneratedKey(boolean generatedKey) |
T |
unique(cn.featherfly.common.db.builder.ConditionBuilder conditionBuilder)
根据指定条件返回唯一结果.
|
T |
unique(java.lang.String condition,
java.lang.Object... params)
根据查询条件返回唯一对象.
|
int |
update(T entity)
更新.
|
public SimpleORM(java.lang.Class<T> type, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
type - 类型jdbcTemplate - jdbcTemplatepublic SimpleORM(java.lang.Class<T> type, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, java.lang.String dataBase)
type - 类型jdbcTemplate - jdbcTemplatedataBase - 具体库public int save(T entity)
保存.
entity - 对象public int update(T entity)
更新.
entity - 对象public void merge(T entity)
合并操作,将传入对象的非空字段更新进数据库(忽略null).
entity - 对象public int delete(T entity)
删除.
entity - 对象public T get(java.io.Serializable id)
获取指定的对象.
id - 唯一标识cn.featherfly.component.sorm.operate.GetOperate#get(id)public T unique(cn.featherfly.common.db.builder.ConditionBuilder conditionBuilder)
根据指定条件返回唯一结果.
conditionBuilder - 查询条件构建器public T unique(java.lang.String condition, java.lang.Object... params)
根据查询条件返回唯一对象.
condition - 查询条件SQL(不包含where)params - 查询参数public java.util.List<T> list(cn.featherfly.common.db.builder.ConditionBuilder conditionBuilder)
根据指定条件返回查询结果集合.
conditionBuilder - 查询条件构建器public java.util.List<T> list(java.lang.String condition, java.lang.Object... params)
根据指定条件返回查询结果集合.
condition - 查询条件SQL(不包含where)params - 查询参数public java.io.Serializable getIdentity(T entity)
返回唯一标示值
entity - 实体对象public boolean isGeneratedKey()
AbstractExecuteOperate.isGeneratedKey()public void setGeneratedKey(boolean generatedKey)
generatedKey - 是否自动设置生成的主键值AbstractExecuteOperate.setGeneratedKey(boolean)public cn.featherfly.common.db.data.Execution getQueryExecution(cn.featherfly.common.db.builder.ConditionBuilder conditionBuilder)
根据指定条件返回Execution.
conditionBuilder - 查询条件构建器public cn.featherfly.common.db.data.Execution getGetExecution(java.io.Serializable id)
返回获取指定对象的Execution.
id - 唯一标识public cn.featherfly.common.db.data.Execution getSaveExecution(T entity)
返回保存对象的Execution.
entity - 对象public cn.featherfly.common.db.data.Execution getUpdateExecution(T entity)
返回更新对象的Execution.
entity - 对象public cn.featherfly.common.db.data.Execution getDeleteExecution(T entity)
返回删除对象的Execution.
entity - 对象