Package org.apache.commons.dbutils
Class GenerousBeanProcessor
- java.lang.Object
-
- org.apache.commons.dbutils.BeanProcessor
-
- org.apache.commons.dbutils.GenerousBeanProcessor
-
public class GenerousBeanProcessor extends BeanProcessor
Provides generous name matching (e.g. underscore-aware) from DB columns to Java Bean properties.- Since:
- 1.6
-
-
Field Summary
-
Fields inherited from class org.apache.commons.dbutils.BeanProcessor
PROPERTY_NOT_FOUND
-
-
Constructor Summary
Constructors Constructor Description GenerousBeanProcessor()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int[]
mapColumnsToProperties(java.sql.ResultSetMetaData rsmd, java.beans.PropertyDescriptor[] props)
The positions in the returned array represent column numbers.-
Methods inherited from class org.apache.commons.dbutils.BeanProcessor
getWriteMethod, newInstance, populateBean, processColumn, toBean, toBeanList
-
-
-
-
Method Detail
-
mapColumnsToProperties
protected int[] mapColumnsToProperties(java.sql.ResultSetMetaData rsmd, java.beans.PropertyDescriptor[] props) throws java.sql.SQLException
Description copied from class:BeanProcessor
The positions in the returned array represent column numbers. The values stored at each position represent the index in thePropertyDescriptor[]
for the bean property that matches the column name. If no bean property was found for a column, the position is set toPROPERTY_NOT_FOUND
.- Overrides:
mapColumnsToProperties
in classBeanProcessor
- Parameters:
rsmd
- TheResultSetMetaData
containing column information.props
- The bean property descriptors.- Returns:
- An int[] with column index to property index mappings. The 0th element is meaningless because JDBC column indexing starts at 1.
- Throws:
java.sql.SQLException
- if a database access error occurs
-
-