public class BeanPropertyRowMapper<T> extends Object implements org.springframework.jdbc.core.RowMapper<T>
两倍有余 BeanPropertyRowMapper 的性能,对比结果见 官网文档 说明。
支持更多类型映射,如:JSONObject、JSONArray
支持 JSONField 注解
| 构造器和说明 |
|---|
BeanPropertyRowMapper(Class<T> mappedClass)
Create a new
BeanPropertyRowMapper, accepting unpopulated
properties in the target bean. |
| 限定符和类型 | 方法和说明 |
|---|---|
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). |
public BeanPropertyRowMapper(Class<T> mappedClass)
BeanPropertyRowMapper, accepting unpopulated
properties in the target bean.
Consider using the newInstance(java.lang.Class<T>) factory method instead,
which allows for specifying the mapped type once only.
mappedClass - the class that each row should be mapped topublic T mapRow(ResultSet rs, int rowNum) throws SQLException
mapRow 在接口中 org.springframework.jdbc.core.RowMapper<T>SQLExceptionpublic static <T> BeanPropertyRowMapper<T> newInstance(Class<T> mappedClass)
BeanPropertyRowMapper
(with the mapped class specified only once).mappedClass - the class that each row should be mapped toCopyright © 2021 Pivotal Software, Inc.. All rights reserved.