|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectnet.hasor.db.jdbc.core.mapper.AbstractRowMapper<Map<String,Object>>
net.hasor.db.jdbc.core.mapper.ColumnMapRowMapper
public class ColumnMapRowMapper
RowMapper implementation that creates a java.util.Map
for each row, representing all columns as key-value pairs: one
entry for each column, with the column name as key.
The Map implementation to use and the key to use for each column
in the column Map can be customized through overriding
createColumnMap(int) and getColumnKey(java.lang.String), respectively.
Note: By default, ColumnMapRowMapper will try to build a linked Map with case-insensitive keys, to preserve column order as well as allow any casing to be used for column names. This requires Commons Collections on the classpath (which will be autodetected). Else, the fallback is a standard linked HashMap, which will still preserve column order but requires the application to specify the column names in the same casing as exposed by the driver.
JdbcTemplate.queryForList(String),
JdbcTemplate.queryForMap(String)| 构造方法摘要 | |
|---|---|
ColumnMapRowMapper()
|
|
| 方法摘要 | |
|---|---|
protected Map<String,Object> |
createColumnMap(int columnCount)
创建一个 Map 用于存放数据 |
protected String |
getColumnKey(String columnName)
讲列名转换为合理的格式。 |
protected Object |
getColumnValue(ResultSet rs,
int index)
取得指定列的值 |
Map<String,Object> |
mapRow(ResultSet rs,
int rowNum)
实现这个方法为结果集的一行记录进行转换,并将最终转换结果返回。 |
| 从类 net.hasor.db.jdbc.core.mapper.AbstractRowMapper 继承的方法 |
|---|
convertValueToRequiredType, getResultSetValue |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public ColumnMapRowMapper()
| 方法详细信息 |
|---|
public final Map<String,Object> mapRow(ResultSet rs,
int rowNum)
throws SQLException
RowMapper 复制的描述
rs - 记录集rowNum - 当前记录的行号
SQLException
protected Object getColumnValue(ResultSet rs,
int index)
throws SQLException
SQLExceptionprotected String getColumnKey(String columnName)
protected Map<String,Object> createColumnMap(int columnCount)
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||