org.apache.tapestry.contrib.table.model.sql
Class SimpleSqlTableDataSource

java.lang.Object
  extended by org.apache.tapestry.contrib.table.model.sql.SimpleSqlTableDataSource
All Implemented Interfaces:
ISqlTableDataSource

public class SimpleSqlTableDataSource
extends Object
implements ISqlTableDataSource

Version:
$Id: SimpleSqlTableDataSource.java 243791 2004-02-19 17:38:13Z hlship $
Author:
mindbridge

Constructor Summary
SimpleSqlTableDataSource(ISqlConnectionSource objConnSource, String strTableName)
           
SimpleSqlTableDataSource(ISqlConnectionSource objConnSource, String strTableName, String strWhereClause)
           
 
Method Summary
 void closeResultSet(ResultSet objResultSet)
           
protected  String generateColumnList(SqlTableColumnModel objColumnModel)
           
protected  String generateCountQuery()
           
protected  String generateDataQuery(SqlTableColumnModel objColumnModel, SimpleTableState objState)
           
protected  String generateLimitClause(ITablePagingState objPagingState)
           
protected  String generateOrderByClause(ITableSortingState objSortingState)
           
protected  String generateWhereClause()
           
 ISqlConnectionSource getConnSource()
          Returns the connSource.
 ResultSet getCurrentRows(SqlTableColumnModel objColumnModel, SimpleTableState objState)
           
 int getRowCount()
           
 String getTableName()
          Returns the tableName.
 String getWhereClause()
          Returns the whereClause.
protected  String quoteObjectName(String strObject)
           
 void setConnSource(ISqlConnectionSource connSource)
          Sets the connSource.
 void setTableName(String tableName)
          Sets the tableName.
 void setWhereClause(String whereClause)
          Sets the whereClause.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSqlTableDataSource

public SimpleSqlTableDataSource(ISqlConnectionSource objConnSource,
                                String strTableName)

SimpleSqlTableDataSource

public SimpleSqlTableDataSource(ISqlConnectionSource objConnSource,
                                String strTableName,
                                String strWhereClause)
Method Detail

getRowCount

public int getRowCount()
                throws SQLException
Specified by:
getRowCount in interface ISqlTableDataSource
Throws:
SQLException
See Also:
ISqlTableDataSource.getRowCount()

getCurrentRows

public ResultSet getCurrentRows(SqlTableColumnModel objColumnModel,
                                SimpleTableState objState)
                         throws SQLException
Specified by:
getCurrentRows in interface ISqlTableDataSource
Throws:
SQLException
See Also:
ISqlTableDataSource.getCurrentRows(SqlTableColumnModel, SimpleTableState)

closeResultSet

public void closeResultSet(ResultSet objResultSet)
Specified by:
closeResultSet in interface ISqlTableDataSource
See Also:
ISqlTableDataSource.closeResultSet(ResultSet)

quoteObjectName

protected String quoteObjectName(String strObject)

getTableName

public String getTableName()
Returns the tableName.

Returns:
String

setTableName

public void setTableName(String tableName)
Sets the tableName.

Parameters:
tableName - The tableName to set

getConnSource

public ISqlConnectionSource getConnSource()
Returns the connSource.

Returns:
ISqlConnectionSource

setConnSource

public void setConnSource(ISqlConnectionSource connSource)
Sets the connSource.

Parameters:
connSource - The connSource to set

getWhereClause

public String getWhereClause()
Returns the whereClause.

Returns:
String

setWhereClause

public void setWhereClause(String whereClause)
Sets the whereClause.

Parameters:
whereClause - The whereClause to set

generateColumnList

protected String generateColumnList(SqlTableColumnModel objColumnModel)

generateWhereClause

protected String generateWhereClause()

generateOrderByClause

protected String generateOrderByClause(ITableSortingState objSortingState)

generateLimitClause

protected String generateLimitClause(ITablePagingState objPagingState)

generateDataQuery

protected String generateDataQuery(SqlTableColumnModel objColumnModel,
                                   SimpleTableState objState)

generateCountQuery

protected String generateCountQuery()