类 ColumnMapRowMapper
- java.lang.Object
-
- ai.yue.library.data.jdbc.support.ColumnMapRowMapper
-
- 所有已实现的接口:
org.springframework.jdbc.core.RowMapper<com.alibaba.fastjson.JSONObject>
public class ColumnMapRowMapper extends Object implements org.springframework.jdbc.core.RowMapper<com.alibaba.fastjson.JSONObject>
参考 ColumnMapRowMapper,替换为 fastjson 的 JSONObject- 从以下版本开始:
- 2020年11月2日
- 作者:
- ylyue
-
-
构造器概要
构造器 构造器 说明 ColumnMapRowMapper()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected com.alibaba.fastjson.JSONObjectcreateColumnMap(int columnCount)Create a Map instance to be used as column map.protected StringgetColumnKey(String columnName)Determine the key to use for the given column in the column Map.protected ObjectgetColumnValue(ResultSet rs, int index)Retrieve a JDBC object value for the specified column.com.alibaba.fastjson.JSONObjectmapRow(ResultSet rs, int rowNum)
-
-
-
方法详细资料
-
mapRow
public com.alibaba.fastjson.JSONObject mapRow(ResultSet rs, int rowNum) throws SQLException
- 指定者:
mapRow在接口中org.springframework.jdbc.core.RowMapper<com.alibaba.fastjson.JSONObject>- 抛出:
SQLException
-
createColumnMap
protected com.alibaba.fastjson.JSONObject createColumnMap(int columnCount)
Create a Map instance to be used as column map.By default, a linked case-insensitive Map will be created.
- 参数:
columnCount- the column count, to be used as initial capacity for the Map- 返回:
- the new Map instance
- 另请参阅:
LinkedCaseInsensitiveMap
-
getColumnKey
protected String getColumnKey(String columnName)
Determine the key to use for the given column in the column Map.- 参数:
columnName- the column name as returned by the ResultSet- 返回:
- the column key to use
- 另请参阅:
ResultSetMetaData.getColumnName(int)
-
getColumnValue
@Nullable protected Object getColumnValue(ResultSet rs, int index) throws SQLException
Retrieve a JDBC object value for the specified column.The default implementation uses the
getObjectmethod. Additionally, this implementation includes a "hack" to get around Oracle returning a non standard object for their TIMESTAMP datatype.- 参数:
rs- is the ResultSet holding the dataindex- is the column index- 返回:
- the Object returned
- 抛出:
SQLException- 另请参阅:
JdbcUtils.getResultSetValue(java.sql.ResultSet, int, java.lang.Class<?>)
-
-