|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectnet.paoding.rose.jade.rowmapper.BeanPropertyRowMapper
public class BeanPropertyRowMapper
RowMapper implementation that converts a row into a new instance
of the specified mapped target class. The mapped target class must be a
top-level class and it must have a default or no-arg constructor.
Column values are mapped based on matching the column name as obtained from result set metadata to public setters for the corresponding properties. The names are matched either directly or by transforming a name separating the parts with underscores to the same name using "camel" case.
Mapping is provided for fields in the target class for many common
types, e.g.: String, boolean, Boolean, byte, Byte, short, Short, int,
Integer, long, Long, float, Float, double, Double, BigDecimal,
java.util.Date, etc.
To facilitate mapping between columns and fields that don't have matching names, try using column aliases in the SQL statement like "select fname as first_name from customer".
Please note that this class is designed to provide convenience rather than high performance. For best performance consider using a custom RowMapper.
| 字段摘要 | |
|---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses |
| 构造方法摘要 | |
|---|---|
BeanPropertyRowMapper(Class<?> mappedClass,
boolean checkColumns,
boolean checkProperties)
Create a new BeanPropertyRowMapper, accepting unpopulated properties in the target bean. |
|
| 方法摘要 | |
|---|---|
protected void |
initialize()
Initialize the mapping metadata for the given class. |
Object |
mapRow(ResultSet rs,
int rowNumber)
Extract the values for all columns in the current row. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected final org.apache.commons.logging.Log logger
| 构造方法详细信息 |
|---|
public BeanPropertyRowMapper(Class<?> mappedClass,
boolean checkColumns,
boolean checkProperties)
mappedClass - the class that each row should be mapped to| 方法详细信息 |
|---|
protected void initialize()
mappedClass - the mapped class.
public Object mapRow(ResultSet rs,
int rowNumber)
throws SQLException
Utilizes public setters and result set metadata.
org.springframework.jdbc.core.RowMapper 中的 mapRowSQLExceptionResultSetMetaData
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||