类 ClassDaoBase<T>

java.lang.Object
com.gdxsoft.easyweb.datasource.ClassDaoBase<T>
直接已知子类:
EwaModDownloadDao, EwaWfCnnDao, EwaWfDao, EwaWfUnitDao

public class ClassDaoBase<T> extends Object
  • 构造器详细资料

    • ClassDaoBase

      public ClassDaoBase()
  • 方法详细资料

    • createAllUpdateFields

      public Map<String,Boolean> createAllUpdateFields(String[] fieldLst)
      创建所用更新字段
      参数:
      fieldLst -
      返回:
    • deleteRecords

      public boolean deleteRecords(String whereString, RequestValue rv)
      删除多条记录
      参数:
      whereString - 查询条件,注意过滤“'”符号,避免SQL注入攻击
      rv -
      返回:
    • getRecords

      public ArrayList<T> getRecords(String whereString)
      根据查询条件返回多条记录(限制为500条)
      参数:
      whereString - 查询条件,注意过滤“'”符号,避免SQL注入攻击
      返回:
      记录集合
    • getRecords

      public ArrayList<T> getRecords(String whereString, List<String> fields)
      根据查询条件返回多条记录(限制为500条)
      参数:
      whereString - 查询条件,注意过滤“'”符号,避免SQL注入攻击
      fields - 指定返回的字段
      返回:
      记录集合
    • getRecords

      public ArrayList<T> getRecords(String whereString, String pkFieldName, int pageSize, int currentPage)
      根据查询条件返回多条记录(限制为500条)
      参数:
      whereString - 查询条件,注意过滤“'”符号,避免SQL注入攻击
      pkFieldName - 主键
      pageSize - 每页记录数
      currentPage - 当前页
      返回:
      记录集合
    • updateRecord

      public boolean updateRecord(T para)
      更新一条记录
      参数:
      para - 表GRP_MAIN的映射类
      返回:
      是否成功
    • updateRecord

      public boolean updateRecord(T para, Map<String,Boolean> updateFields)
      更新一条记录
      参数:
      para - 表GRP_MAIN的映射类
      updateFields - 变化的字段Map
      返回:
    • createRequestValue

      public RequestValue createRequestValue(T para)
      根据字段创建Rv
      参数:
      para -
      返回:
    • parseFromDTTable

      public List<T> parseFromDTTable(DTTable tb) throws Exception
      从 DTTable返回指定的类对象
      参数:
      tb - The source table
      返回:
      The target class list
      抛出:
      Exception - the exception
    • createSelectSql

      public String createSelectSql(String tableName, String where, List<String> fields)
      创建 查询的 sql语句
      参数:
      tableName - 表名
      where - 查询条件
      fields - 返回的 字段列表
      返回:
    • createDeleteSql

      public String createDeleteSql()
    • createDeleteSql

      public String createDeleteSql(boolean includePk)
    • createPkSql

      public String createPkSql()
    • getErrorMsg

      public String getErrorMsg()
    • executeSequence

      public int executeSequence(String seqName) throws SQLException
      抛出:
      SQLException
    • executeInt

      public int executeInt(String sql) throws SQLException
      抛出:
      SQLException
    • executeDouble

      public double executeDouble(String sql) throws SQLException
      抛出:
      SQLException
    • getRecordCount

      public int getRecordCount(String sql)
    • getSqlUpdate

      public String getSqlUpdate()
      创建 更新的SQL,排除主键的所有字段
      返回:
    • sqlUpdateChanged

      public String sqlUpdateChanged(String tableName, String[] keys, Map<String,Boolean> updateFields)
      创建 更新变化 SQL
      参数:
      tableName - 表名
      keys - 主键
      updateFields - 更新字段
      返回:
    • sqlInsertChanged

      public String sqlInsertChanged(String tableName, Map<String,Boolean> updateFields, ClassBase ref)
      创建 新建变化的 SQL
      参数:
      tableName - 表名
      updateFields - 更新字段
      返回:
    • executeUpdate

      public boolean executeUpdate(String sql, RequestValue requestValue)
    • executeUpdateAutoIncrement

      public int executeUpdateAutoIncrement(String sql, RequestValue requestValue)
      执行自增插入
      参数:
      sql -
      requestValue -
      返回:
    • executeUpdateAutoIncrementReturnBigInteger

      public BigInteger executeUpdateAutoIncrementReturnBigInteger(String sql, RequestValue requestValue)
      执行自增插入
      参数:
      sql -
      requestValue -
      返回:
    • executeUpdateAutoIncrementLong

      public long executeUpdateAutoIncrementLong(String sql, RequestValue requestValue)
      执行自增插入
      参数:
      sql -
      requestValue -
      返回:
    • executeUpdateAutoIncrementUInt32

      public com.gdxsoft.easyweb.utils.types.UInt32 executeUpdateAutoIncrementUInt32(String sql, RequestValue requestValue)
      执行自增插入,返回UInt32
      参数:
      sql -
      requestValue -
      返回:
    • executeUpdateAutoIncrementUInt16

      public com.gdxsoft.easyweb.utils.types.UInt16 executeUpdateAutoIncrementUInt16(String sql, RequestValue requestValue)
      执行自增插入,返回UInt16
      参数:
      sql -
      requestValue -
      返回:
    • executeUpdateAutoIncrementUInt64

      public com.gdxsoft.easyweb.utils.types.UInt64 executeUpdateAutoIncrementUInt64(String sql, RequestValue requestValue)
      执行自增插入,返回UInt64
      参数:
      sql -
      requestValue -
      返回:
    • executeProcdure

      public HashMap<String,Object> executeProcdure(String procName, RequestValue requestValue)
    • executeQuery

      public ArrayList<T> executeQuery(String sql, T obj, String[] fieldList)
    • executeQuery

      public ArrayList<T> executeQuery(String sql, T obj, String[] fieldList, String pkFieldName, int pageSize, int currentPage)
    • executeQueryByFields

      public ArrayList<Object[]> executeQueryByFields(String sql, Integer[] fieldList, String pkFieldName, int pageSize, int currentPage)
      获取指定字段的对象列表
      参数:
      sql -
      fieldList -
      pkFieldName -
      pageSize -
      currentPage -
      返回:
    • executeQuery

      public DTTable executeQuery(String sql, String pkFieldName, int pageSize, int currentPage) throws Exception
      执行分页并返回DTTable
      参数:
      sql -
      pkFieldName -
      pageSize -
      currentPage -
      抛出:
      Exception
    • executeQuery

      public ArrayList<T> executeQuery(String sql, RequestValue requestValue, T obj, String[] fieldList)
    • getSqlFields

      public String[] getSqlFields()
    • getSqlSelect

      public String getSqlSelect()
    • getSqlDelete

      public String getSqlDelete()
    • getSqlInsert

      public String getSqlInsert()
    • setSqlInsert

      public void setSqlInsert(String sqlInsert)
      参数:
      sqlInsert - the sqlInsert to set
    • getConfigName

      public String getConfigName()
    • setConfigName

      public void setConfigName(String configName)
    • getConn

      public DataConnection getConn()
    • getRv

      public RequestValue getRv()
    • setRv

      public void setRv(RequestValue rv)
    • getInstanceClass

      public Class<?> getInstanceClass()
      返回:
      the instanceClass
    • setInstanceClass

      public void setInstanceClass(Class<?> instanceClass)
      参数:
      instanceClass - the instanceClass to set
    • getTableName

      public String getTableName()
      返回:
      the tableName
    • setTableName

      public void setTableName(String tableName)
      参数:
      tableName - the tableName to set
    • getFields

      public String[] getFields()
      返回:
      the fields
    • setFields

      public void setFields(String[] fields)
      参数:
      fields - the fields to set
    • getKeyFields

      public String[] getKeyFields()
      返回:
      the keyFields
    • setKeyFields

      public void setKeyFields(String[] keyFields)
      参数:
      keyFields - the keyFields to set
    • getDatabase

      public String getDatabase()
      数据库
      返回:
    • setDatabase

      public void setDatabase(String database)
      数据库
      参数:
      database -
    • getAutoKey

      public String getAutoKey()
      自增主键
      返回:
      the autoKey
    • setAutoKey

      public void setAutoKey(String autoKey)
      自增主键
      参数:
      autoKey - the autoKey to set