| java.lang.Object com.uwyn.rife.database.DbRowProcessor com.uwyn.rife.database.DbBeanFetcher
DbBeanFetcher | public class DbBeanFetcher extends DbRowProcessor (Code) | | This class allows a
ResultSet to be easily processed into bean
instance.
Multiple instances can be collected into a list when processing an
entire
ResultSet , or as a single bean instance can be retrieved for
one row of a
ResultSet . The default behavior is to not collect
instances.
author: JR Boyens (jboyens[remove] at uwyn dot com) author: Geert Bevin (gbevin[remove] at uwyn dot com) version: $Revision: 3701 $ since: 1.0 |
DbBeanFetcher | public DbBeanFetcher(Datasource datasource, Class<BeanType> beanClass) throws BeanException(Code) | | Create a new DbBeanFetcher
Parameters: datasource - the datasource to be used Parameters: beanClass - the type of bean that will be handled exception: BeanException - thrown if there is an error gettinginformation about the bean via the beanClass since: 1.0 |
DbBeanFetcher | public DbBeanFetcher(Datasource datasource, Class<BeanType> beanClass, boolean collectInstances) throws BeanException(Code) | | Create a new DbBeanFetcher
Parameters: datasource - the datasource to be used Parameters: beanClass - the type of bean that will be handled Parameters: collectInstances - true if the fetcher shouldcollected the bean instances; false if otherwise exception: BeanException - thrown if there is an error gettinginformation about the bean via the beanClass since: 1.0 |
getBeanInstance | public BeanType getBeanInstance()(Code) | | Get the last processed bean instance
the last processed bean instance since: 1.0 |
getCollectedInstances | public List<BeanType> getCollectedInstances()(Code) | | Get the collected bean instances
the collected bean instances since: 1.0 |
gotBeanInstance | public boolean gotBeanInstance(BeanType instance)(Code) | | Hook method that can be overloaded to receive new bean instances as
they are retrieved, without relying on the internal collection into
a list.
Parameters: instance - the received bean instance true if the bean fetcher should continue toretrieve the next bean; orfalse if the retrieval should stop after this bean since: 1.0
|
processRow | public boolean processRow(ResultSet resultSet) throws SQLException(Code) | | Process a ResultSet row into a bean. Call this method on a
ResultSet and the resulting bean will be stored and be accessible
via
DbBeanFetcher.getBeanInstance() Parameters: resultSet - the ResultSet from which to process therow exception: SQLException - thrown when there is a problem processingthe row true if a bean instance was retrieved; orfalse if otherwise
|
|
|