net.mlw.vlh.adapter.jdbc
Class AbstractJdbcAdapter

java.lang.Object
  extended bynet.mlw.vlh.adapter.AbstractValueListAdapter
      extended bynet.mlw.vlh.adapter.jdbc.AbstractJdbcAdapter
All Implemented Interfaces:
ValueListAdapter
Direct Known Subclasses:
AbstractDynaJdbcAdapter, DefaultWrapperAdapter, SpringDaoValueListAdapter

public abstract class AbstractJdbcAdapter
extends AbstractValueListAdapter

This adapter handles the standard functionality of creating a query and execution it... If you set validator, it will use special ResultSetDecorator.

Version:
$Revision: 1.27 $ $Date: 2006/04/18 17:15:05 $
Author:
Matthew L. Wilson, Andrej Zachar
See Also:
ResultSetDecorator

Field Summary
 
Fields inherited from interface net.mlw.vlh.ValueListAdapter
DO_FILTER, DO_FOCUS, DO_NOTHING, DO_PAGE, DO_SORT
 
Constructor Summary
AbstractJdbcAdapter()
           
 
Method Summary
 ConnectionCreator getConnectionCreator()
           
 DataSource getDataSource()
           
 String getSql()
           
 SqlPagingSupport getSqlPagingSupport()
           
 StatementBuilder getStatementBuilder()
           
 ObjectValidator getValidator()
           
 ValueList getValueList(String name, ValueListInfo info)
          Gets a ValueList
 boolean isShowSql()
           
abstract  List processResultSet(String name, ResultSet result, int numberPerPage, ValueListInfo info)
          This method takes the result and puts the VOs in the List.
 void setConnectionCreator(ConnectionCreator connectionCreator)
           
 void setDataSource(DataSource dataSource)
           
 void setShowSql(boolean showSql)
           
 void setSql(String sql)
           
 void setSqlPagingSupport(SqlPagingSupport sqlPagingSupport)
           
 void setStatementBuilder(StatementBuilder statementBuilder)
           
 void setValidator(ObjectValidator objectValidator)
           If is set to not null value, it uses a special ResultsSetDecorator, that enable or disable filtering objects in the final valuelist.
 
Methods inherited from class net.mlw.vlh.adapter.AbstractValueListAdapter
getAdapterType, getDefaultNumberPerPage, getDefaultSortColumn, getDefaultSortDirectionInteger, setAdapterType, setDefaultNumberPerPage, setDefaultSortColumn, setDefaultSortDirection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJdbcAdapter

public AbstractJdbcAdapter()
Method Detail

getValueList

public ValueList getValueList(String name,
                              ValueListInfo info)
Description copied from interface: ValueListAdapter
Gets a ValueList

Parameters:
info - The ValueList information
name - The name of the ValueList
Returns:
The ValueList
See Also:
ValueListAdapter.getValueList(java.lang.String, net.mlw.vlh.ValueListInfo)

processResultSet

public abstract List processResultSet(String name,
                                      ResultSet result,
                                      int numberPerPage,
                                      ValueListInfo info)
                               throws SQLException
This method takes the result and puts the VOs in the List.

Parameters:
result - The ResultSet to interate through.
info - is ussually constant during this process, you can use it for passing additional parameters from controler. (Like in DefaultWrapperAdapter)
Returns:
The List of VOs.
Throws:
SQLException

getDataSource

public DataSource getDataSource()
Returns:
Returns the dataSource.

setDataSource

public void setDataSource(DataSource dataSource)
Parameters:
dataSource - The dataSource to set.

getSql

public String getSql()
Returns:
Returns the sql.

setSql

public void setSql(String sql)
Parameters:
sql - The sql to set.

getStatementBuilder

public StatementBuilder getStatementBuilder()
Returns:
Returns the statementBuilder.

setStatementBuilder

public void setStatementBuilder(StatementBuilder statementBuilder)
Parameters:
statementBuilder - The statementBuilder to set.

isShowSql

public boolean isShowSql()
Returns:
Returns the showSql.

setShowSql

public void setShowSql(boolean showSql)
Parameters:
showSql - The showSql to set.

getValidator

public ObjectValidator getValidator()
Returns:
Returns the objectValidator.

setValidator

public void setValidator(ObjectValidator objectValidator)

If is set to not null value, it uses a special ResultsSetDecorator, that enable or disable filtering objects in the final valuelist.

NOTE:

It respects the total count of entries that overlap your paged list. Simply spoken it supports features such as paging.

Parameters:
objectValidator - The objectValidator to set. The null value means that validator is disabled.
See Also:
ObjectValidator, ResultSetDecorator

getConnectionCreator

public ConnectionCreator getConnectionCreator()
Returns:
Returns the connectionCreator.

setConnectionCreator

public void setConnectionCreator(ConnectionCreator connectionCreator)
Parameters:
connectionCreator - The connectionCreator to set.

getSqlPagingSupport

public SqlPagingSupport getSqlPagingSupport()

setSqlPagingSupport

public void setSqlPagingSupport(SqlPagingSupport sqlPagingSupport)


Copyright © 2003-2006 mlavilson. All Rights Reserved.