The Spring Framework

org.springframework.jdbc.core
Class AbstractBeanPropertyRowMapper

java.lang.Object
  extended by org.springframework.jdbc.core.AbstractBeanPropertyRowMapper
Direct Known Subclasses:
BeanPropertyRowMapper, ParameterizedBeanPropertyRowMapper

public abstract class AbstractBeanPropertyRowMapper
extends Object

Abstract base class for BeanPropertyRowMapper implementations. Provides initialization of mapped/persistent fields metadata and the actual mapping between bean properties and SQL table columns.

Since:
2.5
Author:
trisberg

Nested Class Summary
protected  class AbstractBeanPropertyRowMapper.PersistentField
          A PersistentField represents the info we are interested in knowing about the fields and their relationship to the columns of the database table.
 
Field Summary
protected  Log logger
          Logger available to subclasses
protected  Class mappedClass
          The class we are mapping to
 
Constructor Summary
AbstractBeanPropertyRowMapper()
           
 
Method Summary
protected  Object doMapRow(ResultSet rs, int rowNumber)
           
protected  void doSetMappedClass(Class mappedClass)
          Set the class that each row should be mapped to.
 Class getMappedClass()
          Get the class that we are mapping to.
protected  void initialize(Class mappedClass)
          Initialize the mapping metadata
static String underscoreName(String name)
          Convert a name in camelCase to an underscored name in lower case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Log logger
Logger available to subclasses


mappedClass

protected Class mappedClass
The class we are mapping to

Constructor Detail

AbstractBeanPropertyRowMapper

public AbstractBeanPropertyRowMapper()
Method Detail

doSetMappedClass

protected void doSetMappedClass(Class mappedClass)
Set the class that each row should be mapped to.

Parameters:
mappedClass - the mapped class

getMappedClass

public Class getMappedClass()
Get the class that we are mapping to.

Returns:
the mapped class

doMapRow

protected Object doMapRow(ResultSet rs,
                          int rowNumber)
                   throws SQLException
Throws:
SQLException

initialize

protected void initialize(Class mappedClass)
Initialize the mapping metadata

Parameters:
mappedClass -

underscoreName

public static String underscoreName(String name)
Convert a name in camelCase to an underscored name in lower case. Any upper case letters are converted to lower case with a preceding underscore.

Parameters:
name - The string containing original name
Returns:
The name converted

The Spring Framework

Copyright © 2002-2007 The Spring Framework.