JIDE 3.5.15

com.jidesoft.database
Class BatchedCrudTableModelWrapper

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.jidesoft.grid.TableModelWrapperImpl
          extended by com.jidesoft.database.BatchedCrudTableModelWrapper
All Implemented Interfaces:
BatchedOperations, CrudRowOperations, CrudTableModel, ColumnIdentifierTableModel, ContextSensitiveTableModel, EditorStyleTableModel, IndexChangeEventGenerator, MultiTableModel, NavigableModel, SpanModel, StyleModel, TableModelWrapper, Serializable, EventListener, TableModelListener, TableModel

public class BatchedCrudTableModelWrapper
extends TableModelWrapperImpl
implements CrudTableModel, TableModelWrapper, BatchedOperations

See Also:
Serialized Form

Field Summary
protected  com.jidesoft.database.TableModelCache _cache
           
 
Fields inherited from class com.jidesoft.grid.TableModelWrapperImpl
_model
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Fields inherited from interface com.jidesoft.grid.MultiTableModel
FOOTER_COLUMN, HEADER_COLUMN, REGULAR_COLUMN
 
Fields inherited from interface com.jidesoft.grid.EditorStyleTableModel
EDITOR_STYLE_EDITABLE, EDITOR_STYLE_NORMAL, EDITOR_STYLE_READ_ONLY, EDITOR_STYLE_SELECT_ONLY
 
Constructor Summary
BatchedCrudTableModelWrapper(TableModel model)
           
 
Method Summary
 void commit()
          Push changes
protected  Record createRowRecord()
           
 void deleteRow(int rowIndex)
          Delete data of a designated row.
protected  int getActualIndexAt(int row)
           
 int getRowCount()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 void insertRow(Record record)
          CrudTableModel interface implementation
 boolean isAutoCommit()
          Return the commit mode
 Record readRow(int rowIndex)
          Read data of a designated row.
protected  void resetState()
           
 void rollback()
          Go back to the initial state
 void setAutoCommit(boolean autoCommit)
          Establish if the changes are immediate or belong to a transaction
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 void updateRow(int rowIndex, Record record)
          Update data of a designated row with data.
 
Methods inherited from class com.jidesoft.grid.TableModelWrapperImpl
addIndexChangeListener, createCompoundTableModelEvent, fireIndexChanged, fireIndexChanging, fireTableCellsUpdated, fireTableChanged, getActualModel, getCellClassAt, getCellSpanAt, getCellStyleAt, getColumnClass, getColumnCount, getColumnIdentifier, getColumnName, getColumnType, getConverterContextAt, getEditorContextAt, getEditorStyleAt, getIndexChangeListeners, getTableIndex, isCellEditable, isCellSpanOn, isCellStyleOn, isNavigableAt, isNavigationOn, removeIndexChangeListener, tableCellsUpdated, tableChanged, tableDataChanged, tableDataChanged, tableRowsDeleted, tableRowsInserted, tableRowsUpdated, tableStructureChanged
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, isCellEditable, removeTableModelListener
 
Methods inherited from interface com.jidesoft.grid.TableModelWrapper
getActualModel
 

Field Detail

_cache

protected com.jidesoft.database.TableModelCache _cache
Constructor Detail

BatchedCrudTableModelWrapper

public BatchedCrudTableModelWrapper(TableModel model)
Method Detail

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel
Overrides:
getRowCount in class TableModelWrapperImpl

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel
Overrides:
getValueAt in class TableModelWrapperImpl

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class TableModelWrapperImpl

rollback

public void rollback()
Description copied from interface: BatchedOperations
Go back to the initial state

Specified by:
rollback in interface BatchedOperations

getActualIndexAt

protected int getActualIndexAt(int row)

resetState

protected void resetState()

commit

public void commit()
            throws Exception
Description copied from interface: BatchedOperations
Push changes

Specified by:
commit in interface BatchedOperations
Throws:
Exception

insertRow

public void insertRow(Record record)
               throws Exception
CrudTableModel interface implementation

Specified by:
insertRow in interface CrudRowOperations
Parameters:
record - the data structure
Throws:
Exception - if encouting any database update error

readRow

public Record readRow(int rowIndex)
               throws Exception
Description copied from interface: CrudRowOperations
Read data of a designated row.

Specified by:
readRow in interface CrudRowOperations
Parameters:
rowIndex - the row index
Returns:
the data structure
Throws:
Exception - if encouting any database read error

createRowRecord

protected Record createRowRecord()

updateRow

public void updateRow(int rowIndex,
                      Record record)
               throws Exception
Description copied from interface: CrudRowOperations
Update data of a designated row with data.

Specified by:
updateRow in interface CrudRowOperations
Parameters:
rowIndex - the row index
record - the data array
Throws:
Exception - if encouting any database update error

deleteRow

public void deleteRow(int rowIndex)
               throws Exception
Description copied from interface: CrudRowOperations
Delete data of a designated row.

Specified by:
deleteRow in interface CrudRowOperations
Parameters:
rowIndex - the row index
Throws:
Exception - if encouting any database update error.

setAutoCommit

public void setAutoCommit(boolean autoCommit)
Description copied from interface: BatchedOperations
Establish if the changes are immediate or belong to a transaction

Specified by:
setAutoCommit in interface BatchedOperations

isAutoCommit

public boolean isAutoCommit()
Description copied from interface: BatchedOperations
Return the commit mode

Specified by:
isAutoCommit in interface BatchedOperations
Returns:

JIDE 3.5.15