|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry.contrib.table.model.common.AbstractTableModel org.apache.tapestry.contrib.table.model.sql.SqlTableModel
public class SqlTableModel
An implementation of ITableModel that obtains its data through SQL queries. This is a very efficient model, since it uses SQL to perform the data sorting (through ORDER BY) and obtains only the data on the current page (through LIMIT/OFFSET).
This object is typically created in the following manner:
ISqlConnectionSource objConnSrc = new SimpleSqlConnectionSource("jdbc:postgresql://localhost/testdb", "testdb", "testdb"); ISqlTableDataSource objDataSrc = new SimpleSqlTableDataSource(objConnSrc, "test_table"); SqlTableColumnModel objColumnModel = new SqlTableColumnModel(new SqlTableColumn[] { new SqlTableColumn("language", "Language", true), new SqlTableColumn("country", "Country", true), new SqlTableColumn("variant", "Variant", true), new SqlTableColumn("intvalue", "Integer", true), new SqlTableColumn("floatvalue", "Float", true) }); ITableModel objTableModel = new SqlTableModel(objDataSrc, objColumnModel); return objTableModel;
Constructor Summary | |
---|---|
SqlTableModel(ISqlTableDataSource objDataSource,
SqlTableColumnModel objColumnModel)
|
|
SqlTableModel(ISqlTableDataSource objDataSource,
SqlTableColumnModel objColumnModel,
SimpleTableState objState)
|
Method Summary | |
---|---|
ITableColumnModel |
getColumnModel()
Method getColumnModel. |
Iterator |
getCurrentPageRows()
Method getCurrentPageRows. |
protected int |
getRowCount()
|
SqlTableColumnModel |
getSqlColumnModel()
|
ISqlTableDataSource |
getSqlDataSource()
Returns the dataSource. |
Methods inherited from class org.apache.tapestry.contrib.table.model.common.AbstractTableModel |
---|
getPageCount, getPagingState, getSortingState, getState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SqlTableModel(ISqlTableDataSource objDataSource, SqlTableColumnModel objColumnModel)
public SqlTableModel(ISqlTableDataSource objDataSource, SqlTableColumnModel objColumnModel, SimpleTableState objState)
Method Detail |
---|
public ITableColumnModel getColumnModel()
ITableModel
ITableModel.getColumnModel()
public SqlTableColumnModel getSqlColumnModel()
public Iterator getCurrentPageRows()
ITableModel
ITableModel.getCurrentPageRows()
public ISqlTableDataSource getSqlDataSource()
protected int getRowCount()
getRowCount
in class AbstractTableModel
AbstractTableModel.getRowCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |