|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.araneaframework.backend.list.helper.BaseListSqlHelper.BeanResultReader
Resultset reader that uses beanToResultSetMapping in
ListSqlHelper to construct a given type of Bean list.
| Field Summary | |
protected BeanMapper |
beanMapper
|
protected String[] |
columnNames
|
protected String[] |
fieldNames
|
protected Class[] |
fieldTypes
|
protected Class |
itemClass
|
protected List |
results
|
| Constructor Summary | |
BaseListSqlHelper.BeanResultReader(Class itemClass)
|
|
| Method Summary | |
protected Object |
createBean()
|
List |
getResults()
Returns the results. |
void |
init()
Cache all the field names, field types and column names to be used for each row. |
void |
processRow(ResultSet rs)
Processes ResultSet row passing it with the
new Bean instance to readBeanFields(ResultSet, Object)
method. |
protected void |
readBeanField(ResultSet rs,
String rsColumn,
Object bean,
String beanField,
Class fieldType)
Reads the bean field from ResultSet. |
protected void |
readBeanFields(ResultSet rs,
Object bean)
Reads the bean from ResultSet. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Class itemClass
protected List results
protected BeanMapper beanMapper
protected String[] fieldNames
protected Class[] fieldTypes
protected String[] columnNames
| Constructor Detail |
public BaseListSqlHelper.BeanResultReader(Class itemClass)
itemClass - Bean type.| Method Detail |
public void init()
public void processRow(ResultSet rs)
ResultSet row passing it with the
new Bean instance to readBeanFields(ResultSet, Object)
method.
processRow in interface RowCallbackHandlerrs - the ResultSet to processprotected Object createBean()
protected void readBeanFields(ResultSet rs,
Object bean)
ResultSet. Implementations
may override it to read beans in a custom way.
rs - ResultSet containing the results of database
query.bean - bean to read.
protected void readBeanField(ResultSet rs,
String rsColumn,
Object bean,
String beanField,
Class fieldType)
ResultSet.
Implementations may override it to read bean fields in a custom
way. A usual situation would be when a bean field is read from
more than one ResultSet field.
rs - ResultSet containing the results of database
query.rsColumn - name of the result set column to read from.bean - bean to read.beanField - name of the bean field to read to.fieldType - type of the bean field.public List getResults()
getResults in interface ResultReader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||