public interface JdbcDao
| 限定符和类型 | 方法和说明 |
|---|---|
int |
delete(Class<?> clazz,
Long id)
删除记录
|
int |
delete(Criteria criteria)
根据Criteria删除
|
int |
delete(Object entity)
删除记录 此方法会以实体中不为空的字段为条件
|
<T> T |
get(Class<T> clazz,
Long id)
根据主键得到记录
|
<T> T |
get(Criteria criteria,
Long id)
根据主键得到记录
|
Long |
insert(Criteria criteria)
插入一条记录 自动处理主键
|
Long |
insert(Object entity)
插入一条记录 自动处理主键
|
int |
queryCount(Class<?> clazz)
查询记录数
|
int |
queryCount(Criteria criteria)
查询记录数
|
int |
queryCount(Object entity)
查询记录数
|
int |
queryCount(Object entity,
Criteria criteria)
查询记录数
|
<T> List<T> |
queryList(Class<?> clazz)
按设置的条件查询
|
<T> List<T> |
queryList(Criteria criteria)
按设置的条件查询
|
<T> List<T> |
queryList(T entity)
查询列表
|
<T> List<T> |
queryList(T entity,
Criteria criteria)
查询列表
|
List<Map<String,Object>> |
queryListForSql(String refSql)
根据sql查询行的map列表
|
<T> List<T> |
queryListForSql(String refSql,
Class<T> elementType)
根据sql查询行的map列表
|
List<Map<String,Object>> |
queryListForSql(String refSql,
Object[] params)
根据sql查询行的map列表
|
<T> List<T> |
queryListForSql(String refSql,
Object[] params,
Class<T> elementType)
根据sql查询行的map列表
|
List<Map<String,Object>> |
queryListForSql(String refSql,
String expectParamKey,
Object[] params)
根据sql查询行的map列表
|
<T> List<T> |
queryListForSql(String refSql,
String expectParamKey,
Object[] params,
Class<T> elementType)
根据sql查询行的map列表
|
<T> T |
queryObject(Criteria criteria)
查询单个对象,例如count(*) max(id)这类只有一个结果的sql
|
Object |
queryObjectForSql(String refSql)
根据sql查询单个结果
|
Object |
queryObjectForSql(String refSql,
Object[] params)
根据sql查询单个结果
|
Object |
queryObjectForSql(String refSql,
String expectParamKey,
Object[] params)
根据sql查询单个结果
|
<T> List<T> |
queryObjectList(Criteria criteria,
Class<T> elementType)
查询单个对你的列表,例如id列表,name列表
|
Map<String,Object> |
queryRowMap(Criteria criteria)
查询列表 例如使用函数后和列不排斥的情况
|
List<Map<String,Object>> |
queryRowMapList(Criteria criteria)
查询列表 例如使用函数后和列不排斥的情况
|
<T> T |
querySingleResult(Criteria criteria)
查询单个记录
|
<T> T |
querySingleResult(T entity)
查询单个记录
|
Map<String,Object> |
querySingleResultForSql(String refSql)
根据sql查询单个结果行的map
|
<T> T |
querySingleResultForSql(String refSql,
Class<T> elementType)
根据sql查询单个结果
|
Map<String,Object> |
querySingleResultForSql(String refSql,
Object[] params)
根据sql查询单个结果行的map
|
<T> T |
querySingleResultForSql(String refSql,
Object[] params,
Class<T> elementType)
根据sql查询单个结果
|
Map<String,Object> |
querySingleResultForSql(String refSql,
String expectParamKey,
Object[] params)
根据sql查询单个结果行的map
|
<T> T |
querySingleResultForSql(String refSql,
String expectParamKey,
Object[] params,
Class<T> elementType)
根据sql查询单个结果
|
void |
save(Criteria criteria)
保存一条记录,不处理主键
|
void |
save(Object entity)
保存一条记录,不处理主键
|
int |
update(Criteria criteria)
根据Criteria更新
|
int |
update(Object entity)
根据实体更新
|
int |
update(Object entity,
boolean isIgnoreNull)
根据实体更新
|
int |
updateForSql(String refSql)
执行sql
|
int |
updateForSql(String refSql,
Object[] params)
执行sql
|
int |
updateForSql(String refSql,
String expectParamKey,
Object[] params)
执行sql
|
void save(Object entity)
entity - void save(Criteria criteria)
criteria - the criteriaint update(Criteria criteria)
criteria - the criteriaint update(Object entity)
entity - the entityint update(Object entity, boolean isIgnoreNull)
entity - isIgnoreNull - 是否忽略null值的属性 默认trueint delete(Criteria criteria)
criteria - the criteriaint delete(Object entity)
entity - <T> List<T> queryList(Criteria criteria)
T - the type parametercriteria - the criteria<T> List<T> queryList(Class<?> clazz)
T - the type parameterclazz - the clazz<T> List<T> queryList(T entity)
entity - the entity<T> List<T> queryList(T entity, Criteria criteria)
T - the type parameterentity - the entitycriteria - the criteriaint queryCount(Class<?> clazz)
clazz - int queryCount(Object entity)
entity - int queryCount(Criteria criteria)
criteria - the criteriaint queryCount(Object entity, Criteria criteria)
entity - the entitycriteria - the criteria<T> T get(Class<T> clazz, Long id)
T - the type parameterclazz - the clazzid - the id<T> T get(Criteria criteria, Long id)
T - the type parametercriteria - the criteriaid - the id<T> T querySingleResult(T entity)
T - the type parameterentity - the entity<T> T querySingleResult(Criteria criteria)
T - the type parametercriteria - the criteria<T> T queryObject(Criteria criteria)
T - criteria - <T> List<T> queryObjectList(Criteria criteria, Class<T> elementType)
T - criteria - elementType - Map<String,Object> queryRowMap(Criteria criteria)
criteria - List<Map<String,Object>> queryRowMapList(Criteria criteria)
criteria - Object queryObjectForSql(String refSql)
refSql - the ref sqlObject queryObjectForSql(String refSql, Object[] params)
refSql - params - the paramsObject queryObjectForSql(String refSql, String expectParamKey, Object[] params)
refSql - the ref sqlexpectParamKey - 写sql时访问的参数变量名称params - the paramsMap<String,Object> querySingleResultForSql(String refSql)
refSql - the ref sql<T> T querySingleResultForSql(String refSql, Class<T> elementType)
T - the type parameterrefSql - the ref sqlelementType - the element typeMap<String,Object> querySingleResultForSql(String refSql, Object[] params)
refSql - the ref sqlparams - the params<T> T querySingleResultForSql(String refSql, Object[] params, Class<T> elementType)
T - the type parameterrefSql - the ref sqlparams - the paramselementType - the element typeMap<String,Object> querySingleResultForSql(String refSql, String expectParamKey, Object[] params)
refSql - the ref sqlexpectParamKey - 写sql时访问的参数变量名称params - the params<T> T querySingleResultForSql(String refSql, String expectParamKey, Object[] params, Class<T> elementType)
T - the type parameterrefSql - the ref sqlexpectParamKey - 写sql时访问的参数变量名称params - the paramselementType - the element typeList<Map<String,Object>> queryListForSql(String refSql)
refSql - <T> List<T> queryListForSql(String refSql, Class<T> elementType)
T - the type parameterrefSql - the ref sqlelementType - the element typeList<Map<String,Object>> queryListForSql(String refSql, Object[] params)
refSql - params - the params<T> List<T> queryListForSql(String refSql, Object[] params, Class<T> elementType)
T - the type parameterrefSql - the ref sqlparams - the paramselementType - the element typeList<Map<String,Object>> queryListForSql(String refSql, String expectParamKey, Object[] params)
refSql - the ref sqlexpectParamKey - 写sql时访问的参数变量名称params - the params<T> List<T> queryListForSql(String refSql, String expectParamKey, Object[] params, Class<T> elementType)
T - the type parameterrefSql - the ref sqlexpectParamKey - 写sql时访问的参数变量名称params - the paramselementType - the element typeint updateForSql(String refSql)
refSql - the ref sqlint updateForSql(String refSql, Object[] params)
refSql - the ref sqlparams - the paramsCopyright © 2016. All rights reserved.