|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectnet.hasor.jdbc.core.mapper.BeanPropertyRowMapper<T>
public class BeanPropertyRowMapper<T>
用于 POJO 的 RowMapper
| 构造方法摘要 | |
|---|---|
BeanPropertyRowMapper()
Create a new BeanPropertyRowMapper. |
|
BeanPropertyRowMapper(Class<T> requiredType)
Create a new BeanPropertyRowMapper. |
|
| 方法摘要 | ||
|---|---|---|
protected Object |
getColumnValue(ResultSet rs,
int index)
Retrieve a JDBC object value for the specified column, using the most appropriate value type. |
|
protected Object |
getColumnValue(ResultSet rs,
int index,
Class requiredType)
Retrieve a JDBC object value for the specified column. |
|
boolean |
isCaseInsensitive()
|
|
T |
mapRow(ResultSet rs,
int rowNum)
实现这个方法为结果集的一行记录进行转换,并将最终转换结果返回。 |
|
static
|
newInstance(Class<T> mappedClass)
Static factory method to create a new BeanPropertyRowMapper (with the mapped class specified only once). |
|
void |
setCaseInsensitive(boolean caseInsensitive)
|
|
void |
setRequiredType(Class<T> requiredType)
Set the type that each result object is expected to match. |
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public BeanPropertyRowMapper()
setRequiredType(java.lang.Class) public BeanPropertyRowMapper(Class<T> requiredType)
requiredType - the type that each result object is expected to match| 方法详细信息 |
|---|
public void setRequiredType(Class<T> requiredType)
If not specified, the column value will be exposed as returned by the JDBC driver.
public boolean isCaseInsensitive()
public void setCaseInsensitive(boolean caseInsensitive)
public T mapRow(ResultSet rs,
int rowNum)
throws SQLException
RowMapper 复制的描述
RowMapper<T> 中的 mapRowSQLException
protected Object getColumnValue(ResultSet rs,
int index,
Class requiredType)
throws SQLException
The default implementation calls
JdbcUtils.getResultSetValue(java.sql.ResultSet, int, Class).
If no required type has been specified, this method delegates to
getColumnValue(rs, index), which basically calls
ResultSet.getObject(index) but applies some additional
default conversion to appropriate value types.
rs - is the ResultSet holding the dataindex - is the column indexrequiredType - the type that each result object is expected to match
(or null if none specified)
SQLException - in case of extraction failurenet.hasor.jdbc.jdbc.core.util.support.noe.platform.modules.db.jdbcorm.jdbc.support.JdbcUtils#getResultSetValue(java.sql.ResultSet, int, Class),
getColumnValue(java.sql.ResultSet, int)
protected Object getColumnValue(ResultSet rs,
int index)
throws SQLException
The default implementation delegates to JdbcUtils.getResultSetValue(),
which uses the ResultSet.getObject(index) method. Additionally,
it includes a "hack" to get around Oracle returning a non-standard object for
their TIMESTAMP datatype. See the JdbcUtils#getResultSetValue()
javadoc for details.
rs - is the ResultSet holding the dataindex - is the column index
SQLException - in case of extraction failurenet.hasor.jdbc.jdbc.core.util.support.noe.platform.modules.db.jdbcorm.jdbc.support.JdbcUtils#getResultSetValue(java.sql.ResultSet, int)public static <T> BeanPropertyRowMapper<T> newInstance(Class<T> mappedClass)
mappedClass - the class that each row should be mapped to
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||