public interface SqlExecutor
| 限定符和类型 | 字段和说明 |
|---|---|
static SimpleMapWrapper |
mapWrapper |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
delete(SQL sql)
执行delete
|
default int |
delete(String sql) |
default int |
delete(String sql,
Object params) |
void |
exec(SQL sql)
执行sql
|
default void |
exec(String sql) |
default void |
exec(String sql,
Object params) |
int |
insert(SQL sql)
执行insert
|
default int |
insert(String sql,
Object params) |
default List<Map<String,Object>> |
list(SQL sql) |
<T> List<T> |
list(SQL sql,
ObjectWrapper<T> wrapper)
传入SQL对象和对象包装器执行查询,将查询结果通过对象包装器进行包装后返回
|
default List<Map<String,Object>> |
list(String sql) |
default void |
list(String sql,
java.util.function.Consumer<Map<String,Object>> consumer) |
default List<Map<String,Object>> |
list(String sql,
Object params) |
default void |
list(String sql,
Object params,
java.util.function.Consumer<Map<String,Object>> consumer) |
default <T> List<T> |
list(String sql,
Object params,
ObjectWrapper<T> wrapper) |
default <T> List<T> |
list(String sql,
ObjectWrapper<T> wrapper) |
default Map<String,Object> |
single(SQL sql) |
<T> T |
single(SQL sql,
ObjectWrapper<T> wrapper)
传入SQL对象和对象包装器执行查询,将查询结果通过对象包装器进行包装后返回
只返回单个结果,如果sql结果存在多个值,则返回首个值
|
default Map<String,Object> |
single(String sql) |
default Map<String,Object> |
single(String sql,
Object params) |
boolean |
tableExists(String tableName) |
int |
update(SQL sql)
执行update
|
default int |
update(String sql) |
default int |
update(String sql,
Object params) |
static final SimpleMapWrapper mapWrapper
<T> List<T> list(SQL sql, ObjectWrapper<T> wrapper) throws SQLException
T - 查询结果类型泛型sql - sql对象 参照SimpleSQLwrapper - 执行结果对象包装器 参照SimpleMapWrapperSQLException - 执行查询异常<T> T single(SQL sql, ObjectWrapper<T> wrapper) throws SQLException
T - 查询结果类型泛型sql - sql对象 参照SimpleSQLwrapper - 对象包装其SQLException - 执行查询异常void exec(SQL sql) throws SQLException
sql - sql对象 参照SimpleSQLSQLException - 执行异常int update(SQL sql) throws SQLException
sql - sql对象 参照SimpleSQLSQLException - 执行异常int delete(SQL sql) throws SQLException
sql - sql对象 参照SimpleSQLSQLException - 执行异常int insert(SQL sql) throws SQLException
sql - sql对象 参照SimpleSQLSQLException - 执行异常boolean tableExists(String tableName) throws SQLException
SQLExceptiondefault List<Map<String,Object>> list(SQL sql) throws SQLException
SQLExceptiondefault List<Map<String,Object>> list(String sql, Object params) throws SQLException
SQLExceptiondefault <T> List<T> list(String sql, ObjectWrapper<T> wrapper) throws SQLException
SQLExceptiondefault <T> List<T> list(String sql, Object params, ObjectWrapper<T> wrapper) throws SQLException
SQLExceptiondefault void list(String sql, Object params, java.util.function.Consumer<Map<String,Object>> consumer) throws SQLException
SQLExceptiondefault void list(String sql, java.util.function.Consumer<Map<String,Object>> consumer) throws SQLException
SQLExceptiondefault List<Map<String,Object>> list(String sql) throws SQLException
SQLExceptiondefault Map<String,Object> single(SQL sql) throws SQLException
SQLExceptiondefault Map<String,Object> single(String sql, Object params) throws SQLException
SQLExceptiondefault Map<String,Object> single(String sql) throws SQLException
SQLExceptiondefault int insert(String sql, Object params) throws SQLException
SQLExceptiondefault int update(String sql, Object params) throws SQLException
SQLExceptiondefault int update(String sql) throws SQLException
SQLExceptiondefault int delete(String sql, Object params) throws SQLException
SQLExceptiondefault int delete(String sql) throws SQLException
SQLExceptiondefault void exec(String sql) throws SQLException
SQLExceptiondefault void exec(String sql, Object params) throws SQLException
SQLExceptionCopyright © 2019. All rights reserved.