T
- public class SormBeanPropertyRowMapper<T> extends Object implements org.springframework.jdbc.core.RowMapper<T>
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses.
|
Constructor and Description |
---|
SormBeanPropertyRowMapper()
Create a new
SormBeanPropertyRowMapper for bean-style configuration. |
SormBeanPropertyRowMapper(Class<T> mappedClass)
Create a new
SormBeanPropertyRowMapper , accepting unpopulated
properties in the target bean. |
Modifier and Type | Method and Description |
---|---|
Class<T> |
getMappedClass()
Get the class that we are mapping to.
|
protected void |
initialize(Class<T> mappedClass)
Initialize the mapping meta-data for the given class.
|
T |
mapRow(ResultSet rs,
int rowNumber)
Extract the values for all columns in the current row.
|
static <T> SormBeanPropertyRowMapper<T> |
newInstance(Class<T> mappedClass)
Static factory method to create a new
SormBeanPropertyRowMapper
(with the mapped class specified only once). |
void |
setMappedClass(Class<T> mappedClass)
Set the class that each row should be mapped to.
|
protected final org.apache.commons.logging.Log logger
public SormBeanPropertyRowMapper()
SormBeanPropertyRowMapper
for bean-style configuration.setMappedClass(java.lang.Class<T>)
public SormBeanPropertyRowMapper(Class<T> mappedClass)
SormBeanPropertyRowMapper
, 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 void setMappedClass(Class<T> mappedClass)
@Nullable public final Class<T> getMappedClass()
protected void initialize(Class<T> mappedClass)
mappedClass
- the mapped classpublic T mapRow(ResultSet rs, int rowNumber) throws SQLException
Utilizes public setters and result set meta-data.
mapRow
in interface org.springframework.jdbc.core.RowMapper<T>
SQLException
ResultSetMetaData
public static <T> SormBeanPropertyRowMapper<T> newInstance(Class<T> mappedClass)
SormBeanPropertyRowMapper
(with the mapped class specified only once).T
- mappedClass
- the class that each row should be mapped toCopyright © 2020. All rights reserved.