|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectRowMapper
public abstract class RowMapper
Abstract base class for all row mappers. RowMappers are used to map the contents of a row in a ResultSet to the return type of an annotated method. Supported RowMapper types include: HashMap, Map, Object, XmlObject. When a ResultSetMapper is ready to map a ResultSet row to an object, it requests a RowMapper for the return type of the method from the RowMapperFactory.
| Field Summary | |
|---|---|
protected Calendar |
_cal
Calendar instance for date/time mappings. |
protected ResultSet |
_resultSet
ResultSet to map. |
protected Class<?> |
_returnTypeClass
Class to map ResultSet Rows to. |
protected static Pattern |
_setterRegex
|
protected static TypeMappingsFactory |
_tmf
|
| Constructor Summary | |
|---|---|
protected |
RowMapper(ResultSet resultSet,
Class<?> returnTypeClass,
Calendar cal)
Create a new RowMapper for the specified ResultSet and return type Class. |
| Method Summary | |
|---|---|
protected Object |
extractColumnValue(int index,
int resultType)
Extract a column value from the ResultSet and return it as resultType. |
protected String[] |
getKeysFromResultSet()
Build a String array of column names from the ResultSet. |
protected boolean |
isSetterMethod(Method method)
Determine if the given method is a java bean setter method. |
abstract Object |
mapRowToReturnType()
Map a ResultSet row to the return type class |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final TypeMappingsFactory _tmf
protected static final Pattern _setterRegex
protected final ResultSet _resultSet
protected final Calendar _cal
protected final Class<?> _returnTypeClass
| Constructor Detail |
|---|
protected RowMapper(ResultSet resultSet,
Class<?> returnTypeClass,
Calendar cal)
resultSet - ResultSet to mapreturnTypeClass - Class to map ResultSet rows to.cal - Calendar instance for date/time values.| Method Detail |
|---|
public abstract Object mapRowToReturnType()
protected String[] getKeysFromResultSet()
throws SQLException
SQLException - on errorprotected boolean isSetterMethod(Method method)
method - Method to check
protected Object extractColumnValue(int index,
int resultType)
throws SQLException
index - The column index of the value to extract from the ResultSet.resultType - The return type. Defined in TypeMappingsFactory.
SQLException - on error.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||