程序包 gu.sql2java

接口 SqlRunner

所有已知子接口:
TableManager<B>

public interface SqlRunner
  • 方法详细资料

    • runSqlAsList

      List<BaseBean> runSqlAsList(Map<String,Class<?>> targetTypes, String sql, Object... argList)
      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 null
      sql - the SQL statement for retrieving
      argList - the arguments to use fill given prepared statement,may be null
      从以下版本开始:
      3.18.3
    • runSqlAsList

      List<BaseBean> runSqlAsList(String sql, Object... argList) throws RuntimeDaoException
      Load all the elements using a SQL statement specifying a list of fields to be retrieved.
      参数:
      sql - the SQL statement for retrieving
      argList - 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 RuntimeDaoException
      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 null
      sql - the SQL statement for retrieving
      argList - 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 null
      sql - the SQL statement for retrieving
      argList - 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

      <T> T runSqlForValue(Class<T> targetType, String sql, Object... argList) throws RuntimeDaoException
      Load all the elements using a SQL statement specifying a row of a field to be retrieved.
      参数:
      targetType - target type for column or null
      sql - the SQL statement for retrieving
      argList - the arguments to use fill given prepared statement,may be null
      返回:
      SQL statement return value
      抛出:
      RuntimeDaoException
    • runAsTransaction

      <T> T runAsTransaction(Callable<T> fun) throws RuntimeDaoException
      Run Callable<T> as a transaction.
      all exceptions but SQLException threw by Callable<T> is wrapped into RuntimeException
      throw NullPointerException if fun be null
      类型参数:
      T - type of return result
      参数:
      fun -
      返回:
      return T object
      抛出:
      RuntimeDaoException
    • runAsTransaction

      void runAsTransaction(Runnable fun) throws RuntimeDaoException
      Run Runnable as a transaction.no return
      参数:
      fun -
      抛出:
      RuntimeDaoException
      另请参阅:
    • runSql

      boolean runSql(String sql, Object[] argList)
      run a SQL statement as PreparedStatement
      参数:
      sql - the SQL statement for running
      argList - the arguments to use fill given prepared statement,may be null
      返回:
      see Statement.execute(String)
    • runSql

      int runSql(String sql)
      run a SQL statement as Statement. 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

      <T> T runWithNoPage(Callable<T> fun) throws RuntimeDaoException
      run a Callable<T> in Disable PageHelper environment
      类型参数:
      T - type of return result
      参数:
      fun -
      返回:
      return T object
      抛出:
      RuntimeDaoException
      从以下版本开始:
      3.11.1
    • runWithNoPage

      void runWithNoPage(Runnable fun) throws RuntimeDaoException
      run a Runnable in Disable PageHelper environment
      参数:
      fun -
      抛出:
      RuntimeDaoException
      从以下版本开始:
      3.11.1
    • rowCountOf

      long rowCountOf(String sql) throws RuntimeDaoException
      compute row count of SQL statement
      参数:
      sql -
      抛出:
      RuntimeDaoException
      从以下版本开始:
      3.15.4