程序包 gu.sql2java
接口 SqlRunner
- 所有已知子接口:
TableManager<B>
public interface SqlRunner
-
方法概要
修饰符和类型方法说明longrowCountOf(String sql) compute row count of SQL statementvoidrunAsTransaction(Runnable fun) RunRunnableas a transaction.no return<T> TrunAsTransaction(Callable<T> fun) RunCallable<T>as a transaction.
all exceptions butSQLExceptionthrew byCallable<T>is wrapped intoRuntimeException
throwNullPointerExceptioniffunbenullintrun a SQL statement asStatement.booleanrun a SQL statement asPreparedStatement<T> List<T>runSqlAsList(Class<T> targetType, String sql, Object... argList) Load all the elements using a SQL statement specifying a fields to be retrieved.runSqlAsList(String sql, Object... argList) Load all the elements using a SQL statement specifying a list of fields to be retrieved.Load all the elements using a SQL statement specifying a list of fields to be retrieved.Load all the elements using a SQL statement specifying a list of fields to be retrieved.<T> TrunSqlForValue(Class<T> targetType, String sql, Object... argList) Load all the elements using a SQL statement specifying a row of a field to be retrieved.voidrunWithNoPage(Runnable fun) run aRunnablein Disable PageHelper environment<T> TrunWithNoPage(Callable<T> fun) run aCallable<T>in Disable PageHelper environment
-
方法详细资料
-
runSqlAsList
Load all the elements using a SQL statement specifying a list of fields to be retrieved.- 参数:
targetTypes- map of target type for column name or nullsql- the SQL statement for retrievingargList- the arguments to use fill given prepared statement,may be null- 从以下版本开始:
- 3.18.3
-
runSqlAsList
Load all the elements using a SQL statement specifying a list of fields to be retrieved.- 参数:
sql- the SQL statement for retrievingargList- the arguments to use fill given prepared statement,may be null- 返回:
- an list of BaseBean bean, or empty list if no row return
- 抛出:
RuntimeDaoException
-
runSqlForMap
List<Map<String,Object>> runSqlForMap(Map<String, Class<?>> targetTypes, String sql, Object... argList) throws RuntimeDaoExceptionLoad all the elements using a SQL statement specifying a list of fields to be retrieved.- 参数:
targetTypes- map of target type for column name or nullsql- the SQL statement for retrievingargList- the arguments to use fill given prepared statement,may be null- 返回:
- an list of row values map, or empty list if no row return
- 抛出:
RuntimeDaoException
-
runSqlAsList
<T> List<T> runSqlAsList(Class<T> targetType, String sql, Object... argList) throws RuntimeDaoException Load all the elements using a SQL statement specifying a fields to be retrieved.- 参数:
targetType- target type for column or nullsql- the SQL statement for retrievingargList- the arguments to use fill given prepared statement,may be null- 返回:
- an list of row values , or empty list if no row return
- 抛出:
RuntimeDaoException
-
runSqlForValue
Load all the elements using a SQL statement specifying a row of a field to be retrieved.- 参数:
targetType- target type for column or nullsql- the SQL statement for retrievingargList- the arguments to use fill given prepared statement,may be null- 返回:
- SQL statement return value
- 抛出:
RuntimeDaoException
-
runAsTransaction
RunCallable<T>as a transaction.
all exceptions butSQLExceptionthrew byCallable<T>is wrapped intoRuntimeException
throwNullPointerExceptioniffunbenull- 类型参数:
T- type of return result- 参数:
fun-- 返回:
- return T object
- 抛出:
RuntimeDaoException
-
runAsTransaction
RunRunnableas a transaction.no return- 参数:
fun-- 抛出:
RuntimeDaoException- 另请参阅:
-
runSql
run a SQL statement asPreparedStatement- 参数:
sql- the SQL statement for runningargList- the arguments to use fill given prepared statement,may be null- 返回:
- see
Statement.execute(String)
-
runSql
run a SQL statement asStatement. which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.- 参数:
sql- the SQL statement for running- 返回:
- see
Statement.executeUpdate(String sql)
-
runWithNoPage
run aCallable<T>in Disable PageHelper environment- 类型参数:
T- type of return result- 参数:
fun-- 返回:
- return T object
- 抛出:
RuntimeDaoException- 从以下版本开始:
- 3.11.1
-
runWithNoPage
run aRunnablein Disable PageHelper environment- 参数:
fun-- 抛出:
RuntimeDaoException- 从以下版本开始:
- 3.11.1
-
rowCountOf
compute row count of SQL statement- 参数:
sql-- 抛出:
RuntimeDaoException- 从以下版本开始:
- 3.15.4
-