SPT Core API

com.sptci.echo.table
Class TransactionalJDOTableModel<D extends Serializable>

java.lang.Object
  extended by nextapp.echo.app.table.AbstractTableModel
      extended by com.sptci.echo.table.AbstractTableModel<D>
          extended by com.sptci.echo.table.TableModel<D>
              extended by com.sptci.echo.table.DefaultPageableTableModel<D>
                  extended by com.sptci.echo.table.JDOTableModel<D>
                      extended by com.sptci.echo.table.TransactionalJDOTableModel<D>
Type Parameters:
D - The class name of the persistent object backing this model.
All Implemented Interfaces:
PageableTableModel, SortableTableModel, Serializable, TableModel
Direct Known Subclasses:
JDOFilterTableModel

public class TransactionalJDOTableModel<D extends Serializable>
extends JDOTableModel<D>

A table model that automatically handles data store interactions when adding/deleting rows from the model.

© Copyright 2008 Sans Pareil Technologies, Inc.

Version:
$Id: TransactionalJDOTableModel.java 4723 2009-02-28 16:46:02Z rakesh $
Author:
Rakesh Vidyadharan 2008-04-22
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sptci.echo.table.SortableTableModel
SortableTableModel.Direction
 
Field Summary
 
Fields inherited from class com.sptci.echo.table.JDOTableModel
initialised, model
 
Fields inherited from class com.sptci.echo.table.DefaultPageableTableModel
page, pageSize, totalRows
 
Fields inherited from class com.sptci.echo.table.TableModel
columns, data
 
Fields inherited from class com.sptci.echo.table.AbstractTableModel
sortDirection, sortIndex
 
Constructor Summary
protected TransactionalJDOTableModel()
          Default constructor.
  TransactionalJDOTableModel(D model)
          Create a new table model for objects of the specified type.
 
Method Summary
 void addRow(D row)
          Add the specified object to the end of the model.
 void deleteRow(int row)
          Delete the specified row from the model.
 void insertRow(int row, D rowData)
          Insert the specified object at the specified row index into the model.
 void updateRow(int row, D rowData)
          Replace the row specified with the object specified.
 
Methods inherited from class com.sptci.echo.table.JDOTableModel
fetchData, fetchRepository, fetchSortedData, fetchUnsortedData, init, initTotalRows, setPage, setPageSize, sort, sort, sortData
 
Methods inherited from class com.sptci.echo.table.DefaultPageableTableModel
getPage, getPageSize, getTotalPages, setPageSize
 
Methods inherited from class com.sptci.echo.table.TableModel
deleteRow, getColumnAnnotations, getColumnClass, getColumnCount, getColumnName, getObjectAt, getRowCount, getValueAt, processColumnAnnotations, processColumns, processColumnsAnnotation, processFields
 
Methods inherited from class com.sptci.echo.table.AbstractTableModel
getSortDirection
 
Methods inherited from class nextapp.echo.app.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getEventListenerList, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sptci.echo.table.SortableTableModel
getSortDirection
 

Constructor Detail

TransactionalJDOTableModel

protected TransactionalJDOTableModel()
Default constructor. Cannot be directly instantiated.


TransactionalJDOTableModel

public TransactionalJDOTableModel(D model)
Create a new table model for objects of the specified type. Note that callers must invoke JDOTableModel.init() for table model to be initialised.

Parameters:
model - A dummy object used to initialise the table model. Note that the dummy object need not be a persistent instance.
See Also:
JDOTableModel.init()
Method Detail

addRow

public void addRow(D row)
Add the specified object to the end of the model. Over-ridden to persist the object to the data store. If persistence fails the object is not appended to the model.

Overrides:
addRow in class JDOTableModel<D extends Serializable>
Parameters:
row - The data object that is to be added to the model.
See Also:
save(D), TableModel.addRow(D)

insertRow

public void insertRow(int row,
                      D rowData)
Insert the specified object at the specified row index into the model. Over-ridden to persist the rowData object to the data store. If persisting the object fails the model is not updated.

Overrides:
insertRow in class JDOTableModel<D extends Serializable>
Parameters:
row - The index at which the object is to be inserted.
rowData - The object that is to be added to the model.
See Also:
save(D), TableModel.insertRow(int, D)

updateRow

public void updateRow(int row,
                      D rowData)
Replace the row specified with the object specified. Over-ridden to persist the object to the data store prior to delegating to super class implementation. If persisting the object fails, no update is performed on the table model.

Overrides:
updateRow in class TableModel<D extends Serializable>
Parameters:
row - The index at which the object is to be updated.
rowData - The new object that is to be used in the model.
See Also:
TableModel.updateRow(int, D)

deleteRow

public void deleteRow(int row)
Delete the specified row from the model. Over-ridden to delete the persistent instance from the data store. The table model is not modified if the data store could not be modified.

Overrides:
deleteRow in class JDOTableModel<D extends Serializable>
Parameters:
row - The index of the row that is to be deleted.
See Also:
delete(int), TableModel.deleteRow(int)

SPT Core API