org.apache.beehive.controls.system.jdbc
Class RowToObjectMapper

Object
  extended by RowMapper
      extended by RowToObjectMapper

public class RowToObjectMapper
extends RowMapper

Map a ResultSet row to an Object. This mapper uses Java reflection to perform the mapping. The Class being mapped to must have setter methods which match the ResultSet column names. For example, if a column in the ResultSet named USERID, the object must have a setter method named setUserid(). If a setter method cannot be class fields are also checked, the same naming conventions applies, USERID -> userid.


Field Summary
 
Fields inherited from class RowMapper
_cal, _resultSet, _returnTypeClass, _setterRegex, _tmf
 
Method Summary
protected  void getFieldMappings()
          Build the structures necessary to do the mapping
 Object mapRowToReturnType()
          Do the mapping.
 
Methods inherited from class RowMapper
extractColumnValue, getKeysFromResultSet, isSetterMethod
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mapRowToReturnType

public Object mapRowToReturnType()
Do the mapping.

Specified by:
mapRowToReturnType in class RowMapper
Returns:
An object instance.

getFieldMappings

protected void getFieldMappings()
                         throws SQLException
Build the structures necessary to do the mapping

Throws:
SQLException - on error.