程序包 cn.myafx.data

接口 Database

所有超级接口:
AutoCloseable
所有已知实现类:
DatabaseImpl

public interface Database extends AutoCloseable
database
  • 方法详细资料

    • isClose

      Boolean isClose()
      isClose
      返回:
      Boolean
    • isTransaction

      Boolean isTransaction()
      isTransaction
      返回:
      Boolean
    • open

      void open() throws Exception
      open
      抛出:
      Exception - Exception
    • beginTransaction

      void beginTransaction() throws Exception
      beginTransaction
      抛出:
      Exception - Exception
    • beginTransaction

      void beginTransaction(IsolationLevel level) throws Exception
      beginTransaction
      参数:
      level - IsolationLevel
      抛出:
      Exception - Exception
    • commit

      void commit() throws Exception
      commit
      抛出:
      Exception - Exception
    • rollback

      void rollback() throws Exception
      rollback
      抛出:
      Exception - Exception
    • execute

      int execute(String sql, Object... param) throws Exception
      execute update/delete/insert
      参数:
      sql - sql
      param - model or object[]
      返回:
      int
      抛出:
      Exception - Exception
    • queryOne

      <T> T queryOne(String sql, Class<T> clazz, Object... param) throws Exception
      queryOne
      类型参数:
      T - model type
      参数:
      sql - sql
      clazz - model class
      param - model or object[]
      返回:
      moodel
      抛出:
      Exception - Exception
    • queryList

      <T> List<T> queryList(String sql, Class<T> clazz, Object... param) throws Exception
      queryList
      类型参数:
      T - model type
      参数:
      sql - sql
      clazz - model class
      param - model or object[]
      返回:
      moodel list
      抛出:
      Exception - Exception
    • queryOneMap

      Map<String,Object> queryOneMap(String sql, Object... param) throws Exception
      queryOneMap
      参数:
      sql - sql
      param - model or object[]
      返回:
      Map String, Object
      抛出:
      Exception - Exception
    • queryListMap

      List<Map<String,Object>> queryListMap(String sql, Object... param) throws Exception
      queryListMap
      参数:
      sql - sql
      param - model or object[]
      返回:
      List Map String, Object
      抛出:
      Exception - Exception
    • get

      <TModel extends Model> TModel get(Class<TModel> clazz, Map<String,Object> param) throws Exception
      get
      类型参数:
      TModel - model type
      参数:
      clazz - model type
      param - Map String, Object
      返回:
      Model
      抛出:
      Exception - Exception
    • getList

      <TModel extends Model> List<TModel> getList(Class<TModel> clazz, Map<String,Object> param) throws Exception
      getList
      类型参数:
      TModel - model type
      参数:
      clazz - model type
      param - Map String, Object
      返回:
      List TModel
      抛出:
      Exception - Exception
    • add

      int add(String table, Map<String,Object> param) throws Exception
      add
      参数:
      table - table
      param - Map String, Object
      返回:
      int
      抛出:
      Exception - Exception
    • add

      <TModel extends Model> int add(TModel m, String[] ignore) throws Exception
      add model
      类型参数:
      TModel - TModel
      参数:
      m - TModel
      ignore - ignore col
      返回:
      int
      抛出:
      Exception - Exception
    • update

      int update(String table, Map<String,Object> setParam, Map<String,Object> whereParam) throws Exception
      update
      参数:
      table - table
      setParam - update param
      whereParam - where param
      返回:
      int
      抛出:
      Exception - Exception
    • update

      <TModel extends Model> int update(Class<TModel> clazz, Map<String,Object> setParam, Map<String,Object> whereParam) throws Exception
      update
      类型参数:
      TModel - TModel
      参数:
      clazz - TModel class
      setParam - update param
      whereParam - where param
      返回:
      int
      抛出:
      Exception - Exception
    • delete

      int delete(String table, Map<String,Object> whereParam) throws Exception
      delete
      参数:
      table - table
      whereParam - where param
      返回:
      int
      抛出:
      Exception - Exception
    • delete

      <TModel extends Model> int delete(Class<TModel> clazz, Map<String,Object> whereParam) throws Exception
      delete
      类型参数:
      TModel - TModel
      参数:
      clazz - TModel class
      whereParam - where param
      返回:
      int
      抛出:
      Exception - Exception