JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.datasource
Interface DataTableAbstractionLayer

All Known Implementing Classes:
BaseDataTable

public interface DataTableAbstractionLayer

This interface is only of interest to those who wish to implement their own data source using some other implementation. Its methods should never be called directly. They will be called by the implementations of the DataTableModel.

If you do wish to implement your own data source, simply extend BaseDataTable (which abstractly implements these methods) and concretely implement them.

This layer consists of a set of methods that abstract the dependencies between the DataTableModel and the underlying implementation platform (such as JDBC, VCafe, JBuilder).


Method Summary
 Object cloneRow(long bookmark)
          Returns a copy of a row, called by updateCell().
 Object createNewRow()
          Creates a new row, called by addRow().
 Object getCell(long bookmark, String column_identifer)
          Returns a value for given bookmark/column_identifier.
 com.klg.jclass.datasource.DataTableModel materializeTable(com.klg.jclass.datasource.DataModelListener originator, long bookmark, TreeNode childMetaDataModel)
          Called by DataTableModel.createTable to create a new table based on the input criteria.
 void refreshRow(long bookmark)
          Re-reads a row from the originating data source.
 com.klg.jclass.datasource.DataTableModel requeryLevel()
          Requeries the data for the root level DataTable.
 void restoreRow(long bookmark)
          Restores a row's original values, called by cancelRowChanges().
 void saveRow(long bookmark)
          Saves row changes to originating data source.
 void setValueAt(long bookmark, String col_id, Object value)
          Changes the value of an existing cell, called by updateCell() An implementation specific method for setting cell values, it must be implemented in the derived class of BaseDataTable.
 

Method Detail

cloneRow

public Object cloneRow(long bookmark)
                throws DataModelException
Returns a copy of a row, called by updateCell(). An implementation specific method for cloning rows, it must be implemented in the derived class of BaseDataTable. Clones a row so that its original values can be restored when changes are cancelled, or so its values can be used in the WHERE clause upon update.

Parameters:
bookmark - a long which uniquely identifies a row
Returns:
a an Object copy of this row.
Throws:
DataModelException - If clone fails.

setValueAt

public void setValueAt(long bookmark,
                       String col_id,
                       Object value)
                throws Exception
Changes the value of an existing cell, called by updateCell() An implementation specific method for setting cell values, it must be implemented in the derived class of BaseDataTable.

Parameters:
bookmark - a long indicating the row
col_id - a String indicating the column
Throws:
Exception - If update of cell fails.
See Also:
DataTableModel.updateCell(com.klg.jclass.datasource.DataModelListener, long, java.lang.String, java.lang.Object)

restoreRow

public void restoreRow(long bookmark)
Restores a row's original values, called by cancelRowChanges(). An implementation specific method for restoring cell values, it must be implemented in the derived class of BaseDataTable. Will restore values from cache rather than from the data source.

See Also:
DataTableModel.cancelRowChanges(com.klg.jclass.datasource.DataModelListener, long), DataTableModel.requeryRow(com.klg.jclass.datasource.DataModelListener, long)

createNewRow

public Object createNewRow()
                    throws Exception
Creates a new row, called by addRow(). An implementation specific method for creating a new (blank) row, it must be implemented in the derived class of BaseDataTable.

Returns:
an Object which is the new row just added.
Throws:
Exception - If error occurs creating a new row.
See Also:
DataTableModel.addRow(com.klg.jclass.datasource.DataModelListener)

refreshRow

public void refreshRow(long bookmark)
                throws Exception
Re-reads a row from the originating data source. Called by requeryRow(). An implementation specific method for refetching a row, it must be implemented in the derived class of BaseDataTable.

Parameters:
bookmark - a long which uniquely identifies a row
Throws:
Exception - If requery from server fails.
See Also:
DataTableModel.requeryRow(com.klg.jclass.datasource.DataModelListener, long)

saveRow

public void saveRow(long bookmark)
             throws Exception
Saves row changes to originating data source. An implementation specific method for writing a row to the data source. Called by commitRow().

Parameters:
bookmark - a unique long indicating which row to commit to the datasource.
Throws:
Exception - If save fails.
See Also:
DataTableModel.commitRow(com.klg.jclass.datasource.DataModelListener, long)

requeryLevel

public com.klg.jclass.datasource.DataTableModel requeryLevel()
                                                      throws Exception
Requeries the data for the root level DataTable. An implementation specific method to requery the root level node.

Throws:
Exception - If requery from server fails.

getCell

public Object getCell(long bookmark,
                      String column_identifer)
               throws Exception
Returns a value for given bookmark/column_identifier. An implementation specific method for getting a cell value.

Parameters:
bookmark - a long which uniquely identifies this row
Returns:
the Object in the specified cell
Throws:
Exception - If getCell() fails.

materializeTable

public com.klg.jclass.datasource.DataTableModel materializeTable(com.klg.jclass.datasource.DataModelListener originator,
                                                                 long bookmark,
                                                                 TreeNode childMetaDataModel)
                                                          throws DataModelException
Called by DataTableModel.createTable to create a new table based on the input criteria.

Parameters:
bookmark - a long which uniquely identifies a row
childMetaDataModel - a MetaDataModel, this tells this table what structure the child table it is creating should have
Throws:
DataModelException - If materializeTable fails.

Copyright © 2004 Quest Software Inc..
All rights reserved.