Constructor and Description |
---|
BeanRowMapper(Class<T> mapperClass)
Create a new ResultMapper.
|
BeanRowMapper(Class<T> mapperClass,
TypeHandlerRegistry handlerRegistry)
Create a new ResultMapper.
|
Modifier and Type | Method and Description |
---|---|
Collection<FieldInfo> |
allFieldInfoByProperty() |
FieldInfo |
findFieldInfoByProperty(String propertyName) |
Class<T> |
getMapperClass() |
TableInfo |
getTableInfo() |
String |
getTableName()
表名
|
boolean |
isCaseInsensitive() |
T |
mapRow(ResultSet rs,
int rowNum)
实现这个方法为结果集的一行记录进行转换,并将最终转换结果返回。如果返回为 null 等同于忽略该行。
需要注意,不要调用结果集的 next() 方法。
|
static <T> BeanRowMapper<T> |
newInstance(Class<T> mappedClass)
Static factory method to create a new BeanPropertyRowMapper (with the mapped class specified only once).
|
static <T> BeanRowMapper<T> |
newInstance(Class<T> mappedClass,
TypeHandlerRegistry registry)
Static factory method to create a new BeanPropertyRowMapper (with the mapped class specified only once).
|
void |
setCaseInsensitive(boolean caseInsensitive) |
public BeanRowMapper(Class<T> mapperClass, TypeHandlerRegistry handlerRegistry)
public String getTableName()
TableInfo
getTableName
in interface TableInfo
public boolean isCaseInsensitive()
public void setCaseInsensitive(boolean caseInsensitive)
public Collection<FieldInfo> allFieldInfoByProperty()
public TableInfo getTableInfo()
public T mapRow(ResultSet rs, int rowNum) throws SQLException
RowMapper
mapRow
in interface RowMapper<T>
rs
- 记录集rowNum
- 当前记录的行号SQLException
public static <T> BeanRowMapper<T> newInstance(Class<T> mappedClass)
mappedClass
- the class that each row should be mapped topublic static <T> BeanRowMapper<T> newInstance(Class<T> mappedClass, TypeHandlerRegistry registry)
mappedClass
- the class that each row should be mapped toCopyright © 2020. All rights reserved.