public class CommonRepositoryImpl extends Object implements CommonRepository
| 构造器和说明 |
|---|
CommonRepositoryImpl() |
CommonRepositoryImpl(String datasourceName) |
| 限定符和类型 | 方法和说明 |
|---|---|
int[] |
batch(List<String> sql)
批量执行语句
|
int[] |
batch(List<String> sqlList,
int batchSize)
批量执行语句
|
int[] |
batch(String sql,
Object[][] params)
批量执行语句
|
int[] |
batch(String sql,
Object[][] params,
int batchSize)
批量执行语句
|
<T> T |
call(Callable<T> callable)
自定义操作
|
<T extends BaseModel> |
delete(BigInteger id,
Class<T> clz)
删除
|
<T extends BaseModel> |
delete(T t)
删除对象
|
boolean |
executeLargeUpdate(List<String> exeSqlList)
执行脚本,包括ddl
|
boolean |
existTable(String schema,
String table)
是否存在表
|
boolean |
existTableColumn(String schema,
String table,
String column)
是否存在字段
|
String |
getDatabase()
获取数据库对应名称
|
Dialect |
getDialect()
获取数据库类型
|
Object |
insert(String insertSql,
Object... params)
插入语句
|
<T> T |
queryFirstObject(String sql,
Class<T> clazz,
Object... params) |
<T> List<T> |
queryList(Class<T> clz)
查询对应对象的所有值
|
<T> List<T> |
queryList(String nativeSql,
Class<T> clz,
Object... params) |
<T> List<T> |
queryListWithCache(Class<T> clz)
查询对应对象的所有值
|
<T> List<T> |
queryListWithCache(String nativeSql,
Class<T> clz,
Object... params) |
<T> List<T> |
queryObject(String sql,
Class<T> clazz,
Object... params) |
Record |
queryRecord(String sql)
sql查询,单条
|
Record |
queryRecord(String sql,
Object... params)
sql查询,单条
|
List<Record> |
queryRecords(String sql)
sql查询
|
List<Record> |
queryRecords(String sql,
Object... params)
sql查询
|
List<Record> |
queryRecordsWithCache(String sql)
sql查询
|
List<Record> |
queryRecordsWithCache(String sql,
Object... params)
sql查询
|
Record |
queryRecordWithCache(String sql)
sql查询,单条
|
Record |
queryRecordWithCache(String sql,
Object... params)
sql查询,单条
|
<T extends BaseModel> |
save(T t)
保存对象,返回带有主键
|
<T extends BaseModel> |
saveNoPk(T t)
返回无需主键
|
<T> Object |
saveObject(T t)
保存通用对象,返回主键
|
<T> boolean |
saveObjectNoPk(T t)
保存通用对象,无主键返回
|
boolean |
transaction(ITransaction transactions)
执行事务
|
Ret |
transactionWithReturn(ITransaction transactions) |
int |
update(String nativeSql,
Object... params)
更新
|
<T extends BaseModel> |
update(T t)
更新对象
|
public CommonRepositoryImpl()
public CommonRepositoryImpl(String datasourceName)
public String getDatabase()
CommonRepositorygetDatabase 在接口中 CommonRepositorypublic Dialect getDialect()
CommonRepositorygetDialect 在接口中 CommonRepositorypublic <T> T call(Callable<T> callable)
CommonRepositorycall 在接口中 CommonRepositorypublic boolean existTable(String schema, String table)
CommonRepositoryexistTable 在接口中 CommonRepositorypublic boolean existTableColumn(String schema, String table, String column)
CommonRepositoryexistTableColumn 在接口中 CommonRepositorypublic List<Record> queryRecordsWithCache(String sql, Object... params)
CommonRepositoryqueryRecordsWithCache 在接口中 CommonRepositorypublic List<Record> queryRecordsWithCache(String sql)
CommonRepositoryqueryRecordsWithCache 在接口中 CommonRepositorypublic Record queryRecordWithCache(String sql, Object... params)
CommonRepositoryqueryRecordWithCache 在接口中 CommonRepositorypublic Record queryRecordWithCache(String sql)
CommonRepositoryqueryRecordWithCache 在接口中 CommonRepositorypublic boolean transaction(ITransaction transactions)
CommonRepositorytransaction 在接口中 CommonRepositorypublic Ret transactionWithReturn(ITransaction transactions)
transactionWithReturn 在接口中 CommonRepositorypublic <T> List<T> queryObject(String sql, Class<T> clazz, Object... params)
queryObject 在接口中 CommonRepositorypublic <T> T queryFirstObject(String sql, Class<T> clazz, Object... params)
queryFirstObject 在接口中 CommonRepositorypublic int update(String nativeSql, Object... params)
CommonRepositoryupdate 在接口中 CommonRepositorypublic List<Record> queryRecords(String sql, Object... params)
CommonRepositoryqueryRecords 在接口中 CommonRepositorypublic List<Record> queryRecords(String sql)
CommonRepositoryqueryRecords 在接口中 CommonRepositorypublic Record queryRecord(String sql, Object... params)
CommonRepositoryqueryRecord 在接口中 CommonRepositorypublic Record queryRecord(String sql)
CommonRepositoryqueryRecord 在接口中 CommonRepositorypublic <T> List<T> queryListWithCache(Class<T> clz)
CommonRepositoryqueryListWithCache 在接口中 CommonRepositorypublic <T> List<T> queryListWithCache(String nativeSql, Class<T> clz, Object... params)
queryListWithCache 在接口中 CommonRepositorypublic <T> List<T> queryList(Class<T> clz)
CommonRepositoryqueryList 在接口中 CommonRepositorypublic <T> List<T> queryList(String nativeSql, Class<T> clz, Object... params)
queryList 在接口中 CommonRepositorypublic <T extends BaseModel> int update(T t)
CommonRepositoryupdate 在接口中 CommonRepositorypublic <T extends BaseModel> int delete(T t)
CommonRepositorydelete 在接口中 CommonRepositorypublic <T extends BaseModel> int delete(BigInteger id, Class<T> clz)
CommonRepositorydelete 在接口中 CommonRepositorypublic <T extends BaseModel> T save(T t)
CommonRepositorysave 在接口中 CommonRepositorypublic Object insert(String insertSql, Object... params)
CommonRepositoryinsert 在接口中 CommonRepositorypublic <T extends BaseModel> boolean saveNoPk(T t)
CommonRepositorysaveNoPk 在接口中 CommonRepositorypublic <T> boolean saveObjectNoPk(T t)
CommonRepositorysaveObjectNoPk 在接口中 CommonRepositorypublic <T> Object saveObject(T t)
CommonRepositorysaveObject 在接口中 CommonRepositorypublic boolean executeLargeUpdate(List<String> exeSqlList)
CommonRepositoryexecuteLargeUpdate 在接口中 CommonRepositorypublic int[] batch(List<String> sql)
CommonRepositorybatch 在接口中 CommonRepositorysql - sql语句(更新、插入、删除)public int[] batch(String sql, Object[][] params)
CommonRepositorybatch 在接口中 CommonRepositorysql - sql语句(更新、插入、删除)params - 参数public int[] batch(String sql, Object[][] params, int batchSize)
CommonRepositorybatch 在接口中 CommonRepositorysql - sql语句(更新、插入、删除)params - 参数batchSize - 批量提交量public int[] batch(List<String> sqlList, int batchSize)
CommonRepositorybatch 在接口中 CommonRepositorysqlList - sql列表batchSize - 批量提交量Copyright © 2019. All rights reserved.