类 DTTable
java.lang.Object
com.gdxsoft.easyweb.data.DTTable
- 所有已实现的接口:
Serializable
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明addRow()新增一行数据static DTTablefromSerialize(byte[] buf) 从序列化二进制中获取表com.gdxsoft.easyweb.utils.msnet.MTable附加对象,可以添加任意类型对象static DTTablegetCachedTable(String sql, int intLifeSeconds, DataConnection cnn) 获取 cached 表数据static DTTablegetCachedTable(String sql, int intLifeSeconds, String dataSourceName, RequestValue rv) 获取 cached 表数据getCell(int rowIndex, int colIndex) getCellValueByJson(DTCell cell, String contentpath) 创建JSON时,获取Cell值的方法getColAvg(int colIndex) 获取列平均值getColCalc(int colIndex) getColMax(int colIndex) 获取列最大值getColMin(int colIndex) 获取列最小值getColSum(int colIndex) 获取列合计值intgetCount()获取数据行数static DTTablegetJdbcTable(String sql) 获取 JDBC 表,自动关闭连接,使用默认的数据库连接static DTTablegetJdbcTable(String sql, DataConnection conn) 获取 JDBC 表,注意没有关闭数据库连接,请手动关闭
获取数据后,移除该查询的数据集static DTTablegetJdbcTable(String sql, RequestValue rv) 获取 JDBC 表,自动关闭连接static DTTablegetJdbcTable(String sql, String dataSourceName) 获取 JDBC 表,自动关闭连接static DTTablegetJdbcTable(String sql, String pkFiled, int pageSize, int curPage, DataConnection conn) 获取 JDBC 表,注意没有关闭数据库连接,请手动关闭static DTTablegetJdbcTable(String sql, String pkFiled, int pageSize, int curPage, String dataSourceName) 获取 JDBC 分页表,自动关闭连接static DTTablegetJdbcTable(String sql, String pkFiled, int pageSize, int curPage, String dataSourceName, RequestValue rv) 获取 JDBC 分页表,自动关闭连接static DTTablegetJdbcTable(String sql, String dataSourceName, RequestValue rv) 获取 JDBC 表,自动关闭连接设置JSON处理二进制的方法getName()getRow(int index) getRowAvg(int rowIndex) 获取行平均值getRowByKey(DTColumn col, Object val) 根据key值获取数据行
Returns the row form the keygetRowByKey(String colName, Object val) 根据key值获取数据行
Returns the row form the keygetRowByKeys(DTColumn[] cols, Object[] vals) 根据keys值获取数据行
Returns the row form the keysgetRowByKeys(String[] colsNames, Object[] vals) 根据keys值获取数据行
Returns the row form the keysintgetRowMax(int rowIndex) 获取行最大值getRowMin(int rowIndex) 获取行最小值getRows()getRowSum(int rowIndex) 获取行合计
Sum the fieldint用户和系统的时差(分钟)获取XML数据的节点名称获取XML数据的数据节点父节点voidinitColumns(ResultSet rs) 根据ResultSet初始化字段信息
Initialize the table columns from the JDBC resultvoid根据Xml字符串 初始化数据
Initialize the table data from the XML stringvoid根据ResultSet初始化数据
Initialize the table data from the JDBC ResultSetvoid根据ResultSet初始化数据
Initialize the table data from the JDBC ResultSetvoid根据ResultSet初始化数据 Initialize the table data from the JDBC ResultSetvoid根据ResultSet初始化数据 Initialize the table data from the JDBC ResultSetvoid根据List类初始化数据 Initialize the data from the List datavoid根据HashMap类初始化数据
Initialize the data from the Map datavoidinitData(org.json.JSONArray arr) 通过JSONArray创建表
Initialize the table data from the JSON arrayvoid根据XML Document 初始化数据
Initialize the table data from the XML documentvoidinitDataByXmlChildNodes(String xml, String dataTag) 通过节点的子节点的textcontent获取数据
Initialize the table data from specified text node of the XML documentvoidinitDataByXmlChildNodes(Document doc, String dataTag) 通过节点的子节点的textcontent获取数据
Initialize the table data from specified text node of the XML documentvoidinitXmlColumnsByFields(String[] fields, boolean isAttribute) 根据指定的字段初始化字段的XML属性,是否从XML的属性中获取
Initialize the table columns XML "isAttribute" according to the specified, Whether to get the value from the XML element attribute fieldsbooleanbooleanisOk()void连接两个表,将需要连接的表数据放到本表中类似数据库的左联
{"TYPE": "JOIN", "FROM_KEYS": "BAS_TAG", "TO_KEYS": "VIS_STATUS"}voidjoinHor(DTTable fromTable, String[] fromKeys, String[] toKeys, String[] fields, String namedField, String valueField) 合并垂直表将表字段拼接为用“,”分割的字符串表达式,例如:'abc', 'cdf', 'aaa',用于数据库查询的IDvoid重建索引
Rebuild the table indexstatic StringreplaceParameters(String source, RequestValue rv) 替换原始字符串中的@参数voidsetColumns(DTColumns columns) voidsetErrorInfo(String errorInfo) voidsetIsBuildIndex(boolean isBuildIndex) voidsetJsonBinaryHandle(IBinaryHandle binaryHandle) 设置JSON处理二进制的方法voidvoidsetOk(boolean isOk) voidvoidsetTimeDiffMinutes(int timeDiffMinutes) 用户和系统的时差(分钟)voidsetXmlDataTag(String xmlDataTag) List<?>映射表数据到 根据 objectClass 的类
Map the table rows to the target class listtoJson(RequestValue rv) 返回JSON数据 含有图片的最多返回50条记录,其它最多1000条数据org.json.JSONArray返回JSON对象 含有图片的最多返回50条记录,其它最多1000条数据org.json.JSONArray返回JSON对象,二进制数据转换成文件
特征码:##BINARY_FILE["+objBinFile.toString()+"]BINARY_FILE##byte[]序列化表
Serialize the tabletoXml(RequestValue rv) Convert to the XML String
-
构造器详细资料
-
DTTable
public DTTable()
-
-
方法详细资料
-
getTimeDiffMinutes
public int getTimeDiffMinutes()用户和系统的时差(分钟)- 返回:
-
setTimeDiffMinutes
public void setTimeDiffMinutes(int timeDiffMinutes) 用户和系统的时差(分钟)- 参数:
timeDiffMinutes- 分钟
-
getJsonBinaryHandle
设置JSON处理二进制的方法- 返回:
-
setJsonBinaryHandle
设置JSON处理二进制的方法- 参数:
binaryHandle-
-
getCachedTable
public static DTTable getCachedTable(String sql, int intLifeSeconds, String dataSourceName, RequestValue rv) throws IOException, ClassNotFoundException 获取 cached 表数据- 参数:
sql-intLifeSeconds- 最长生命时间dataSourceName-rv-- 返回:
- 抛出:
IOExceptionClassNotFoundException
-
getCachedTable
public static DTTable getCachedTable(String sql, int intLifeSeconds, DataConnection cnn) throws IOException, ClassNotFoundException 获取 cached 表数据- 参数:
sql-intLifeSeconds- 最长生命时间cnn- 数据库连接- 返回:
- 抛出:
IOExceptionClassNotFoundException
-
replaceParameters
替换原始字符串中的@参数- 参数:
source-rv-- 返回:
-
getJdbcTable
获取 JDBC 表,自动关闭连接,使用默认的数据库连接- 参数:
sql-- 返回:
-
getJdbcTable
获取 JDBC 表,自动关闭连接- 参数:
sql-dataSourceName-- 返回:
-
getJdbcTable
获取 JDBC 表,自动关闭连接- 参数:
sql-dataSourceName- 指定连接源rv-- 返回:
-
getJdbcTable
获取 JDBC 表,自动关闭连接- 参数:
sql-rv-- 返回:
-
getJdbcTable
获取 JDBC 表,注意没有关闭数据库连接,请手动关闭
获取数据后,移除该查询的数据集- 参数:
sql-conn-- 返回:
-
getJdbcTable
public static DTTable getJdbcTable(String sql, String pkFiled, int pageSize, int curPage, String dataSourceName) 获取 JDBC 分页表,自动关闭连接- 参数:
sql- 执行查询的语句pkFiled- 主键pageSize- 每页的记录数curPage- 当前页dataSourceName- 数据源- 返回:
-
getJdbcTable
public static DTTable getJdbcTable(String sql, String pkFiled, int pageSize, int curPage, String dataSourceName, RequestValue rv) 获取 JDBC 分页表,自动关闭连接- 参数:
sql- 执行查询的语句pkFiled- 主键pageSize- 每页的记录数curPage- 当前页dataSourceName- 数据源rv- RequestValue- 返回:
-
getJdbcTable
public static DTTable getJdbcTable(String sql, String pkFiled, int pageSize, int curPage, DataConnection conn) 获取 JDBC 表,注意没有关闭数据库连接,请手动关闭- 参数:
sql- 执行查询的语句pkFiled- 主键pageSize- 每页的记录数curPage- 当前页conn- 数据库连接,请手动关闭- 返回:
-
fromSerialize
从序列化二进制中获取表- 参数:
buf-- 返回:
- 抛出:
IOExceptionClassNotFoundException
-
toClasses
映射表数据到 根据 objectClass 的类
Map the table rows to the target class list- 参数:
objectClass- the target class- 返回:
- the target class list
- 抛出:
Exception- the exception
-
toSerialize
序列化表
Serialize the table- 返回:
- the serialized binary
- 抛出:
IOException- the exception
-
initXmlColumnsByFields
根据指定的字段初始化字段的XML属性,是否从XML的属性中获取
Initialize the table columns XML "isAttribute" according to the specified, Whether to get the value from the XML element attribute fields- 参数:
fields- the fields nameisAttribute- 是否从XML的属性中获取
Whether to get the value from the XML element attribute
-
initData
根据XML Document 初始化数据
Initialize the table data from the XML document- 参数:
doc- the XML documentxmlTagName- the tag name
-
initData
根据Xml字符串 初始化数据
Initialize the table data from the XML string- 参数:
xml- the XML stringxmlTagName- the XML tag name
-
initDataByXmlChildNodes
通过节点的子节点的textcontent获取数据
Initialize the table data from specified text node of the XML document- 参数:
doc- the XML documentdataTag- the text node tag name
-
initDataByXmlChildNodes
通过节点的子节点的textcontent获取数据
Initialize the table data from specified text node of the XML document- 参数:
xml- the XML stringdataTag- the XML tag name
-
join
连接两个表,将需要连接的表数据放到本表中类似数据库的左联
{"TYPE": "JOIN", "FROM_KEYS": "BAS_TAG", "TO_KEYS": "VIS_STATUS"}- 参数:
fromTable- 需要连接的表fromKeys- 需要连接的表的主键toKeys- 当前表的主键- 抛出:
Throwable- the exception
-
joinHor
public void joinHor(DTTable fromTable, String[] fromKeys, String[] toKeys, String[] fields, String namedField, String valueField) throws Throwable 合并垂直表- 参数:
fromTable- 来源的纵向表fromKeys- 来源和当前表关联的字段toKeys- 当前表和来源表关联的字段fields- 需要附加的字段namedField- 来源表标记为字段名称的字段 *valueField- 取值用的字段- 抛出:
Throwable- the exception
-
addRow
新增一行数据 -
toJSONArray
public org.json.JSONArray toJSONArray() throws org.json.JSONException返回JSON对象 含有图片的最多返回50条记录,其它最多1000条数据- 返回:
- the JSON array
- 抛出:
org.json.JSONException- the exception
-
getCellValueByJson
创建JSON时,获取Cell值的方法- 参数:
cell- the table cellcontentpath- the binary value save to- 返回:
- the value
-
toJSONArrayBinaryToFile
返回JSON对象,二进制数据转换成文件
特征码:##BINARY_FILE["+objBinFile.toString()+"]BINARY_FILE##- 返回:
- the JSON array
- 抛出:
org.json.JSONException- the exception
-
toJson
返回JSON数据 含有图片的最多返回50条记录,其它最多1000条数据- 参数:
rv- 现在没啥用了- 返回:
- JSONObject
-
toXml
Convert to the XML String- 参数:
rv- the RequestValue- 返回:
- the XML String
-
addXmlNewRow
-
initData
根据ResultSet初始化数据
Initialize the table data from the JDBC ResultSet- 参数:
rs- the JDBC ResultSet
-
initData
根据ResultSet初始化数据
Initialize the table data from the JDBC ResultSet- 参数:
rs- the JDBC ResultSetlimit- 限制返回数量,<=0为不限制
-
initData
根据ResultSet初始化数据 Initialize the table data from the JDBC ResultSet- 参数:
rs- the JDBC ResultSetkeys- 主键表达式 the data keyslimit- 限制返回数量,<=0为不限制
-
initData
根据ResultSet初始化数据 Initialize the table data from the JDBC ResultSet- 参数:
rs- the JDBC ResultSetkeys- 主键表达式 the data keys
-
getRowByKeys
根据keys值获取数据行
Returns the row form the keys- 参数:
cols- keys的字段vals- keys值- 返回:
- the row
-
getRowByKeys
根据keys值获取数据行
Returns the row form the keys- 参数:
colsNames- keys的字段名称vals- keys值- 返回:
- the row
- 抛出:
Exception- the Exception
-
rebuildIndex
public void rebuildIndex()重建索引
Rebuild the table index -
getRowByKey
根据key值获取数据行
Returns the row form the key- 参数:
col- the key columnval- the key value- 返回:
- the row
-
getRowByKey
根据key值获取数据行
Returns the row form the key- 参数:
colName- 字段名称
the key column nameval- 字段值
the key value- 返回:
- the row
-
initData
根据HashMap类初始化数据
Initialize the data from the Map data- 参数:
mapData- the Map data
-
initData
根据List类初始化数据 Initialize the data from the List data- 参数:
listData- the List data
-
initData
通过JSONArray创建表
Initialize the table data from the JSON array- 参数:
arr- the JSON array- 抛出:
Exception- the exception
-
initColumns
根据ResultSet初始化字段信息
Initialize the table columns from the JDBC result- 参数:
rs- the JDBC result
-
getRow
-
getRowIndex
public int getRowIndex() -
getColumns
- 返回:
- the _Columns
-
setColumns
- 参数:
columns- the _Columns to set
-
getRows
- 返回:
- the _Rows
-
setRows
- 参数:
rows- the _Rows to set
-
isOk
public boolean isOk()- 返回:
- the _IsOk
-
getErrorInfo
- 返回:
- the _ErrorInfo
-
getCurRow
- 返回:
- the _CurRow
-
getCount
public int getCount()获取数据行数- 返回:
- the table rows count
-
getCell
-
getCell
- 抛出:
Exception
-
getXmlDataTag
- 返回:
- the _XmlDataTag
-
setXmlDataTag
- 参数:
xmlDataTag- the _XmlDataTag to set
-
isBuildIndex
public boolean isBuildIndex()- 返回:
- the _IsBuildIndex
-
setIsBuildIndex
public void setIsBuildIndex(boolean isBuildIndex) - 参数:
isBuildIndex- the _IsBuildIndex to set
-
getIndexes
- 返回:
- the Indexes
-
getXmlNodeDataParent
获取XML数据的数据节点父节点- 返回:
- the XmlNodeDataParent
-
getXmlDataNodeName
获取XML数据的节点名称- 返回:
- the XmlDataNodeName
-
getName
- 返回:
- the _Name
-
setName
- 参数:
name- the _Name to set
-
getRowSum
获取行合计
Sum the field- 参数:
rowIndex- the field index- 返回:
- the sum result
-
getRowAvg
获取行平均值- 参数:
rowIndex-- 返回:
-
getRowMax
获取行最大值- 参数:
rowIndex-- 返回:
-
getRowMin
获取行最小值- 参数:
rowIndex-- 返回:
-
getColSum
获取列合计值- 参数:
colIndex-- 返回:
-
getColCalc
-
getColAvg
获取列平均值- 参数:
colIndex-- 返回:
-
getColMin
获取列最小值- 参数:
colIndex-- 返回:
-
getColMax
获取列最大值- 参数:
colIndex-- 返回:
-
getAttsTable
public com.gdxsoft.easyweb.utils.msnet.MTable getAttsTable()附加对象,可以添加任意类型对象- 返回:
- the _AttsTable
-
joinIds
将表字段拼接为用“,”分割的字符串表达式,例如:'abc', 'cdf', 'aaa',用于数据库查询的ID- 参数:
fieldName-addQuotationMarks-- 返回:
-
setOk
public void setOk(boolean isOk) -
setErrorInfo
-