public interface JdbcDao
| 限定符和类型 | 方法和说明 |
|---|---|
int |
delete(Class<?> clazz,
Long id)
删除记录
|
int |
delete(Criteria criteria)
根据Criteria删除
|
int |
delete(Object entity)
删除记录 此方法会以实体中不为空的字段为条件
|
void |
deleteAll(Class<?> clazz)
删除所有记录(TRUNCATE ddl权限)
|
<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(Criteria criteria)
查询记录数
|
int |
queryCount(Object entity)
查询记录数
|
int |
queryCount(Object entity,
Criteria criteria)
查询记录数
|
List<Map<String,Object>> |
queryForList(Criteria criteria) |
<T> T |
queryForObject(Criteria criteria) |
List<Map<String,Object>> |
queryForSql(String refSql)
根据sql查询
|
List<Map<String,Object>> |
queryForSql(String refSql,
Object[] params)
根据sql查询
|
List<Map<String,Object>> |
queryForSql(String refSql,
String name,
Object[] params)
根据sql查询
|
<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)
查询列表
|
<T> T |
querySingleResult(Criteria criteria)
查询单个记录
|
<T> T |
querySingleResult(T entity)
查询单个记录
|
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 - void deleteAll(Class<?> clazz)
clazz - the clazz<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(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 queryForObject(Criteria criteria)
List<Map<String,Object>> queryForSql(String refSql, Object[] params)
refSql - params - the paramsList<Map<String,Object>> queryForSql(String refSql, String name, Object[] params)
refSql - the ref sqlname - 写sql时访问的参数变量名称params - the paramsint updateForSql(String refSql)
refSql - the ref sqlint updateForSql(String refSql, Object[] params)
refSql - the ref sqlparams - the paramsCopyright © 2015. All rights reserved.