public class BeanPropertyRowMapper<T> extends AbstractRowMapper<T>
| 构造器和说明 |
|---|
BeanPropertyRowMapper()
Create a new BeanPropertyRowMapper.
|
BeanPropertyRowMapper(Class<T> requiredType)
Create a new BeanPropertyRowMapper.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected Object |
getColumnValue(ResultSet rs,
int index,
Class<?> requiredType)
取得指定列的值
|
boolean |
isCaseInsensitive() |
T |
mapRow(ResultSet rs,
int rowNum)
实现这个方法为结果集的一行记录进行转换,并将最终转换结果返回。
|
static <T> BeanPropertyRowMapper<T> |
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.
|
convertValueToRequiredType, getResultSetValuepublic 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
RowMapperrs - 记录集rowNum - 当前记录的行号SQLExceptionprotected Object getColumnValue(ResultSet rs, int index, Class<?> requiredType) throws SQLException
SQLExceptionpublic static <T> BeanPropertyRowMapper<T> newInstance(Class<T> mappedClass)
mappedClass - the class that each row should be mapped toCopyright © 2014. All rights reserved.