public class BaseDao<T>
extends cn.hutool.core.lang.TypeReference<T>
| 构造器和说明 |
|---|
BaseDao(DataSource dataSource) |
BaseDao(cn.hutool.db.Db db) |
BaseDao(String groupName) |
| 限定符和类型 | 方法和说明 |
|---|---|
cn.hutool.db.Db |
db() |
int |
del(String field,
Object value) |
List<T> |
list() |
List<T> |
query(String sql,
Object... params) |
T |
queryOne(String sql,
Object... params) |
int |
save(T t) |
int[] |
saveBatch(Collection<T> entityList) |
int |
update(T record,
T where)
根据条件更新
|
int |
update(T record,
T where,
boolean ignoreNullValue)
根据条件更新
|
int |
update(T record,
T where,
boolean ignoreNullValue,
T dbRecord)
根据条件更新
|
int |
update(T record,
T where,
T dbRecord)
根据条件更新
|
int |
updateById(T record)
根据id更新
|
int |
updateById(T record,
boolean ignoreNullValue)
根据id更新
|
int |
updateById(T record,
boolean ignoreNullValue,
T dbRecord)
根据id更新
|
int |
updateById(T record,
T dbRecord)
根据id更新
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTypeNamepublic BaseDao(DataSource dataSource)
public BaseDao(String groupName)
public BaseDao(cn.hutool.db.Db db)
public cn.hutool.db.Db db()
public List<T> query(String sql, Object... params) throws SQLException
SQLExceptionpublic T queryOne(String sql, Object... params) throws SQLException
SQLExceptionpublic List<T> list() throws SQLException
SQLExceptionpublic int save(T t) throws SQLException
SQLExceptionpublic int[] saveBatch(Collection<T> entityList) throws SQLException
SQLExceptionpublic int del(String field, Object value) throws SQLException
SQLExceptionpublic int updateById(T record) throws SQLException
record - 准备更新的对象SQLException - 异常public int updateById(T record, boolean ignoreNullValue) throws SQLException
record - 准备更新的对象ignoreNullValue - true 忽略null值SQLException - 异常public int updateById(T record, T dbRecord) throws SQLException
record - 准备更新的对象dbRecord - 数据库对象。不为null时,将会去除掉与record中值相同的字段。避免不必要的更新SQLException - 异常public int updateById(T record, boolean ignoreNullValue, T dbRecord) throws SQLException
record - 准备更新的对象ignoreNullValue - true 忽略null值dbRecord - 数据库对象。不为null时,将会去除掉与record中值相同的字段。避免不必要的更新SQLException - 异常public int update(T record, T where) throws SQLException
record - 准备更新的对象where - 条件对象,自行创建。SQLException - 异常public int update(T record, T where, boolean ignoreNullValue) throws SQLException
record - 准备更新的对象where - 条件对象,自行创建。ignoreNullValue - true 忽略null值SQLException - 异常public int update(T record, T where, T dbRecord) throws SQLException
record - 准备更新的对象where - 条件对象,自行创建。dbRecord - 数据库对象。不为null时,将会去除掉与record中值相同的字段。避免不必要的更新SQLException - 异常public int update(T record, T where, boolean ignoreNullValue, T dbRecord) throws SQLException
record - 准备更新的对象where - 条件对象,自行创建。ignoreNullValue - true 忽略null值dbRecord - 数据库对象。不为null时,将会去除掉与record中值相同的字段。避免不必要的更新SQLException - 异常Copyright © 2021. All rights reserved.