|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.model.mem.DataRow
com.sibvisions.rad.model.mem.ChangeableDataRow
com.sibvisions.rad.model.mem.MemDataBook
public class MemDataBook
The MemDataBook is a storage independent table, and handles all operations
to load, save and manipulate table oriented data.
An MemDataBook has at least one MemDataPage to store all
DataRow's of this MemDataBook. If an MemDataBook
has detail IDataBook's, it handles for each detail IDataBook
the IDataPage's. Thats necessary because every change of the selected
IDataRow needs to initiate the change of the corresponding details.
So the IDataBook adds the appropriate IDataPage's into the
detail IDataBook's.
The MemDataBook is also a IChangeableDataRow, the selected row
of the MemDataBook.
MemDataPage,
IDataPage,
IDataBook,
IRowDefinition,
IChangeableDataRow,
IDataSource,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface javax.rad.model.IDataBook |
|---|
IDataBook.SelectionMode, IDataBook.WriteBackIsolationLevel |
| Field Summary |
|---|
| Fields inherited from class com.sibvisions.rad.model.mem.ChangeableDataRow |
|---|
DELETING, DETAILS_CHANGED, INSERTING, INTERNAL_OFFSET, UPDATING, WRITABLE_COLUMN_CHANGED |
| Fields inherited from class com.sibvisions.rad.model.mem.DataRow |
|---|
oaStorage, rdRowDefinition |
| Constructor Summary | |
|---|---|
MemDataBook()
Contructs a new MemDataBook with an empty RowDefinition. |
|
MemDataBook(RowDefinition pRowDefinition)
Constructs a new MemDataBook with the given RowDefinition. |
|
| Method Summary | |
|---|---|
void |
addDetailDataBook(IDataBook pDetailDataBook)
Registered a new detail IDataBook to this master IDataBook. |
protected void |
clear()
It clears the AbstractStorage of the MemDataBook. |
protected void |
clearFilterSortInMemDataPages()
It clears all mem filter sorts in the MemDataPages. |
void |
close()
Closes the IDataBook. |
protected MemDataPage |
createDataPage(IDataRow pMasterDataRow)
It constructs a new MemDataPage. |
void |
delete()
It deletes the selected DataRow. |
void |
deleteAllDataRows()
It deletes all DataRows. |
DataBookHandler |
eventAfterColumnSelected()
Gets the EventHandler for after column selected event. |
DataBookHandler |
eventAfterDeleted()
Gets the EventHandler for after deleted event. |
DataBookHandler |
eventAfterDeleting()
Gets the EventHandler for after deleting event. |
DataBookHandler |
eventAfterInserted()
Gets the EventHandler for after inserted event. |
DataBookHandler |
eventAfterInserting()
Gets the EventHandler for after inserting event. |
DataBookHandler |
eventAfterReload()
Gets the EventHandler for after reload event. |
DataBookHandler |
eventAfterRestore()
Gets the EventHandler for after restore event. |
DataBookHandler |
eventAfterRowSelected()
Gets the EventHandler for after row selected event. |
DataBookHandler |
eventAfterUpdated()
Gets the EventHandler for after updated event. |
DataBookHandler |
eventAfterUpdating()
Gets the EventHandler for after updating event. |
DataBookHandler |
eventBeforeColumnSelected()
Gets the EventHandler for before column selected event. |
DataBookHandler |
eventBeforeDeleted()
Gets the EventHandler for before deleted event. |
DataBookHandler |
eventBeforeDeleting()
Gets the EventHandler for before deleting event. |
DataBookHandler |
eventBeforeInserted()
Gets the EventHandler for before inserted event. |
DataBookHandler |
eventBeforeInserting()
Gets the EventHandler for before inserting event. |
DataBookHandler |
eventBeforeReload()
Gets the EventHandler for before reload event. |
DataBookHandler |
eventBeforeRestore()
Gets the EventHandler for before restore event. |
DataBookHandler |
eventBeforeRowSelected()
Gets the EventHandler for before row selected event. |
DataBookHandler |
eventBeforeUpdated()
Gets the EventHandler for before updated event. |
DataBookHandler |
eventBeforeUpdating()
Gets the EventHandler for before updating event. |
protected void |
executeDelete()
Its called when the deleting DataRow (delete row) should be deleted. |
protected void |
executeInsert()
Its called when the inserting DataRow (new row) should be inserted. |
protected void |
executeLockAndRefetch()
Its called before the DataRow (existing row) will be changed. |
protected void |
executeRefresh()
It will be called, when the MemDataBook will be completely refreshed. |
protected void |
executeUpdate()
Its called when the updating DataRow (changed row) should be updated Derived classed should override this to implemented the needed functionality. |
void |
fetchAll()
It fetches all IDataRow's from the storage. |
protected void |
finalize()
|
int[] |
getChangedDataRows()
Returns an int array with all changed rows. |
IDataBook |
getDataBook()
Returns the IDataBook of the IDataPage. |
IDataPage |
getDataPage()
Returns the corresponding IDataPage of the IDataRow. |
IDataPage |
getDataPage(IDataRow pMasterDataRow)
Returns the corresponding IDataPage to specified master row
from the master DataBook. |
IDataPage |
getDataPage(IDataRow pRootRow,
TreePath pTreePath)
Gets the IDataPage for the given TreePath and root row. |
IDataPage |
getDataPage(TreePath pTreePath)
Gets the IDataPage for the given TreePath. |
IDataPage |
getDataPageWithRootRow(IDataRow pRootDataRow)
Returns the corresponding IDataPage to specified root row
from the root DataBook. |
IChangeableDataRow |
getDataRow(int pDataRowIndex)
Returns a copy of the IDataRow of the specified index. |
IDataSource |
getDataSource()
Returns the IDataSource for this IDataBook. |
IDataBook[] |
getDetailDataBooks()
Returns all detail IDataBooks to the master IDataBook. |
int |
getEstimatedRowCount()
Returns the row count in IDBAccess for this RemoteDataBook. |
ICondition |
getFilter()
Returns the filter for this IDataBook. |
IDataRow |
getMasterDataRow()
Returns the corresponding master row to this IDataPage in the master DataBook. |
ReferenceDefinition |
getMasterReference()
Returns the ReferenceDefinition to the master IDataBook. |
String |
getName()
Returns the IDataBook name. |
int[] |
getOnlyIUDChangedDataRows()
Returns only all Changed DataRows with the states isInserting(), isUpdating(), isDeleting(). |
IDataRow |
getOriginalRow()
Returns the original row, before the first change is made. |
int |
getReadAhead()
Returns the count of rows which are read ahead from the IDBAccess. |
ReferenceDefinition |
getRootReference()
Gets the tree root reference. |
int |
getRowCount()
Returns the size. |
int |
getRowIndex()
Returns the row index of the IDataRows in the IDataPage. |
String |
getSelectedColumn()
Returns the selected column in the IDataBook. |
int |
getSelectedRow()
Returns the selected row index in the IDataBook. |
IDataBook.SelectionMode |
getSelectionMode()
Returns the selection mode for this IDataBook. |
SortDefinition |
getSort()
Returns the sort order for this IDataBook. |
TreePath |
getTreePath()
Gets the tree current tree path. |
Object |
getUID()
Returns the internal unique identifier for a IChangeableDataRow, which
isInserting(). |
Object |
getValue(String pColumnName)
Returns the value of the named column. |
Object[] |
getValues(String[] pColumnNames)
Returns a Object[] of values from the specified columns in this IDataRow. |
IDataBook.WriteBackIsolationLevel |
getWritebackIsolationLevel()
Returns the current write back isolation level. |
boolean |
hasDataPage(IDataRow pMasterDataRow)
Returns true if an IDataPage to specified master row
from the master DataBook exists. |
boolean |
hasDataPage(IDataRow pRootDataRow,
TreePath pTreePath)
Returns true if an IDataPage to specified root row and TreePath
from the master DataBook exists. |
int |
insert(boolean pBeforeRow)
It inserts a new IDataRow. |
boolean |
isAllFetched()
Returns true if all rows are loaded. |
protected boolean |
isDataPageRefetchPossible()
This function is used for rehashing data pages after insert of the master row. |
boolean |
isDeleteAllowed()
Returns true if delete is allowed on this IDataBook. |
boolean |
isDeleteCascade()
Returns true if all rows of this detail table should be deleted, when the master row is deleted. |
boolean |
isDeleteEnabled()
Returns true if delete is enabled on this IDataBook. |
boolean |
isDeleting()
Returns if this row is deleted. |
boolean |
isDetailChanged()
Returns true if under this row in the detail DataBook one or more changed (isInserting/Updating/Deleting() == true) detail rows existing. |
boolean |
isInsertAllowed()
Returns true if insert is allowed on this IDataBook. |
boolean |
isInsertEnabled()
Returns true if insert is enabled on this IDataBook. |
boolean |
isInserting()
Returns if this row is new. |
boolean |
isLockAndRefetchEnabled()
Returns true if lock and refetch is enabled. |
protected boolean |
isMemFilter()
Returns true if the filter is handled in memory. |
protected boolean |
isMemSort()
Returns true if the sort is handled in memory. |
boolean |
isOpen()
Returns true if the IDataBook is opened. |
boolean |
isOutOfSync()
Gets true, if the IDataBook is not yet initialized after a reload. |
boolean |
isReadonly()
Returns true if this IDataBook is read only. |
boolean |
isSelfJoined()
True, if this IDataBook is self joined. |
boolean |
isUpdateAllowed()
Returns true if update is allowed on this IDataBook. |
boolean |
isUpdateEnabled()
Returns true if update is enabled on this IDataBook. |
boolean |
isUpdating()
Returns if this row is changed. |
boolean |
isWritableColumnChanged()
Returns true if one isWritableColumnChanged() column is changed. |
protected boolean |
isWritebackEnabled()
Returns true if this data book should write its changes to the storage. |
void |
notifyDetailChanged()
It sets the selected row in master, that one or more details rows (from DetailDataBooks) are changed. |
void |
notifyMasterChanged()
Has to be called from the master, if the master changed, to notify all detail IDataBooks. |
void |
open()
Opens the IDataBook. |
void |
reload()
It refreshs all IDataRow's in the IDataBook, like the was before the changes, get the data
again from the storage
It selects the same row (over primary key) if the SelectionMode == CURRENT_ROW in the IDataBook. |
void |
reload(IDataBook.SelectionMode pSelectionMode)
It refreshs all IDataRow's in the IDataBook, like the was before the changes, get the data
again from the storage and selects the row with the specified SelectionMode. |
void |
reloadDataPage(IDataBook.SelectionMode pSelectionMode)
Reload the current DataPage with the pSelectionMode. |
void |
removeDataPage(IDataRow pMasterDataRow,
TreePath pTreePath)
Removes the DataPage to the specified master DataRow or TreePath. |
void |
removeDetailDataBook(IDataBook pDetailDataBook)
Unregister a detail IDataBook from this master IDataBook. |
void |
restoreAllRows()
It restores all IDataRow's, like the was before the changes. |
void |
restoreDataPage()
Restores all rows in the current DataPage. |
void |
restoreSelectedRow()
It restores the selected IDataRow, like the was before the changes. |
void |
saveAllRows()
It stores all changes in the IDataRow's to the IDataSource. |
void |
saveDataPage()
Saves all rows in the current DataPage. |
void |
saveSelectedRow()
It stores all changes in the selected IDataRow. |
int |
searchNext(ICondition pCondition)
Searches the given condition. |
int |
searchNext(ICondition pCondition,
int pRowNum)
Searches the given condition starting at the given position. |
int |
searchPrevious(ICondition pCondition)
Searches the given condition. |
int |
searchPrevious(ICondition pCondition,
int pRowNum)
Searches the given condition starting at the given position. |
void |
setDataSource(IDataSource pDataSource)
Sets the IDataSource for this IDataBook. |
void |
setDeleteCascade(boolean pDeleteCascade)
Sets if all rows of this detail table should be deleted, when the master row is deleted. |
void |
setDeleteEnabled(boolean pDeleteEnabled)
Sets whether delete is enabled on this IDataBook. |
void |
setFilter(ICondition pFilter)
Sets the filter for this IDataBook. |
void |
setInsertEnabled(boolean pInsertEnabled)
Sets whether insert is enabled on this IDataBook. |
void |
setLockAndRefetchEnabled(boolean pLockAndRefetchEnabled)
Sets whether if lock and refetch is enabled. |
void |
setMasterReference(ReferenceDefinition pMasterReference)
Sets the master IDataBook to this detail IDataBook
over a ReferenceDefinition. |
protected void |
setMemFilter(boolean pMemFilter)
Sets if the sort is handled in memory. |
protected void |
setMemSort(boolean pMemSort)
Sets if the sort is handled in memory. |
void |
setName(String pName)
Set the name of the IDataBook. |
void |
setReadAhead(int pReadAheadRowCount)
Sets the count of rows which are read ahead from the IDBAccess. |
void |
setReadOnly(boolean pReadOnly)
Sets whether this IDataBook is read only. |
void |
setReadOnlyWithoutSave(boolean pReadOnly)
Sets the databook readonly but does not automatically save. |
void |
setRootReference(ReferenceDefinition pTreeRootReference)
Sets the tree root reference. |
void |
setRowDefinition(IRowDefinition pRowDefinition)
Sets the IRowDefinition of the IDataBook. |
void |
setSelectedColumn(String pColumnName)
Sets the selected column in the IDataBook. |
void |
setSelectedRow(int pDataRowIndex)
Sets the selected row index in the IDataBook. |
protected void |
setSelectedRowInternal(int pDataRowIndex)
Sets the selected row with throwing any changed events. |
void |
setSelectionMode(IDataBook.SelectionMode pSelectionMode)
Sets the one of the following selection mode for this IDataBook. |
void |
setSort(SortDefinition pSort)
Sets the sort order for this IDataBook. |
void |
setTreePath(TreePath pTreePath)
Sets the tree current tree path. |
void |
setUpdateEnabled(boolean pUpdateEnabled)
Sets whether update is enabled on this IDataBook. |
void |
setValue(String pColumnName,
Object pValue)
Sets the value of the named column in this IDataRow. |
void |
setValues(String[] pColumnNames,
Object[] pValues)
Sets the column's values from the pValues Object[]
to the this IDataRow. |
protected void |
setValuesInternal(String[] pColumnNames,
Object[] pValues)
It sets the values without throwing an event. |
protected void |
setWritebackEnabled(boolean pWritebackEnabled)
Sets if this data book should write back its changes to the storage. |
void |
setWritebackIsolationLevel(IDataBook.WriteBackIsolationLevel pIsolationLevel)
Sets when the IDataSource needs to write back the
data to the storage. |
protected void |
store()
It stores the changes in memory as stored. |
String |
toString()
|
void |
update()
It sets the selected row as UPDATING. |
| Methods inherited from class com.sibvisions.rad.model.mem.ChangeableDataRow |
|---|
restore, setDeleting, setDetailChanged, setInserting, setUID, setUpdating, setValueDRInternal |
| Methods inherited from class com.sibvisions.rad.model.mem.DataRow |
|---|
addControl, cancelEditingControls, compareTo, compareTo, createDataRow, createEmptyRow, equals, equals, eventValuesChanged, getControls, getRowDefinition, getValue, getValueAsString, getValuesAsString, hashCode, invokeCancelEditingControls, invokeRepaintListeners, invokeSaveEditingControls, notifyRepaintControls, removeControl, saveEditingControls, setDefaultValues |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.rad.model.IDataRow |
|---|
addControl, compareTo, createDataRow, createEmptyRow, equals, eventValuesChanged, getControls, getRowDefinition, getValue, getValueAsString, getValuesAsString, removeControl |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Constructor Detail |
|---|
public MemDataBook()
MemDataBook with an empty RowDefinition.
public MemDataBook(RowDefinition pRowDefinition)
MemDataBook with the given RowDefinition.
pRowDefinition - the row definition for the data book| Method Detail |
|---|
public IDataBook getDataBook()
IDataBook of the IDataPage.
getDataBook in interface IDataPageIDataBook of the IDataPage.public String getName()
IDataBook name.
getName in interface IDataBookgetName in interface INamedObjectIDataBook name.
public void setName(String pName)
throws ModelException
IDataBook.
setName in interface IDataBooksetName in interface INamedObjectpName - IDataBook name
ModelException - if the IDataBook is already opened. -> Not allowedpublic void setWritebackIsolationLevel(IDataBook.WriteBackIsolationLevel pIsolationLevel)
IDataSource needs to write back the
data to the storage.DATA_ROW.
setWritebackIsolationLevel in interface IDataBookpIsolationLevel - the new write back isolation level.IDataBook.WriteBackIsolationLevelpublic IDataBook.WriteBackIsolationLevel getWritebackIsolationLevel()
getWritebackIsolationLevel in interface IDataBook
public void setRowDefinition(IRowDefinition pRowDefinition)
throws ModelException
IRowDefinition of the IDataBook.
setRowDefinition in interface IDataBookpRowDefinition - the new IRowDefinition
ModelException - if the IRowDefinition is emptypublic IDataSource getDataSource()
IDataSource for this IDataBook.
getDataSource in interface IDataBookIDataSource for this IDataBook.
public void setDataSource(IDataSource pDataSource)
throws ModelException
IDataSource for this IDataBook.IDataSource defines the access to the storage like DB, XML, ...
setDataSource in interface IDataBookpDataSource - the IDataSource to use for load/save data
ModelException - if the IDataBook is already opened. -> Not allowedIDataSourcepublic ReferenceDefinition getMasterReference()
ReferenceDefinition to the master IDataBook.
getMasterReference in interface IDataBookReferenceDefinition to the master IDataBook.
public void setMasterReference(ReferenceDefinition pMasterReference)
throws ModelException
IDataBook to this detail IDataBook
over a ReferenceDefinition.
setMasterReference in interface IDataBookpMasterReference - the ReferenceDefinition to the master IDataBook.
ModelException - if the IDataBook is openReferenceDefinitionpublic boolean isSelfJoined()
isSelfJoined in interface IDataBook
public IDataPage getDataPage(TreePath pTreePath)
throws ModelException
getDataPage in interface IDataBookpTreePath - the TreePath.
ModelException - if the pRootRow or pTreePath don't contains the master columns from the master
ReferenceDefinition
public IDataPage getDataPage(IDataRow pRootRow,
TreePath pTreePath)
throws ModelException
getDataPage in interface IDataBookpRootRow - the root row.pTreePath - the TreePath.
ModelException - if the pRootRow or pTreePath don't contains the master columns from the master
ReferenceDefinition
public IDataPage getDataPageWithRootRow(IDataRow pRootDataRow)
throws ModelException
IDataPage to specified root row
from the root DataBook. If it doesn't exists, it will be created
and returned.
getDataPageWithRootRow in interface IDataBookpRootDataRow - the root IDataRow of the root DataBook.
IDataPage to specified master row
from the master DataBook.
ModelException - if the pRootRow don't contains the master columns from the master
ReferenceDefinitionpublic ReferenceDefinition getRootReference()
getRootReference in interface IDataBook
public void setRootReference(ReferenceDefinition pTreeRootReference)
throws ModelException
setRootReference in interface IDataBookpTreeRootReference - the tree root reference.
ModelException - if the IDataBook is openpublic TreePath getTreePath()
getTreePath in interface IDataBook
public void setTreePath(TreePath pTreePath)
throws ModelException
setTreePath in interface IDataBookpTreePath - the tree root reference.
ModelException - if the IDataBook is openprotected boolean isDataPageRefetchPossible()
public void notifyMasterChanged()
notifyMasterChanged in interface IDataBook
public void removeDataPage(IDataRow pMasterDataRow,
TreePath pTreePath)
throws ModelException
removeDataPage in interface IDataBookpMasterDataRow - the MasterDataRow to use.pTreePath - the TreePath to use.
ModelException - if the remove of the DataPage didn't worked out.public IDataBook.SelectionMode getSelectionMode()
getSelectionMode in interface IDataBookpublic void setSelectionMode(IDataBook.SelectionMode pSelectionMode)
setSelectionMode in interface IDataBookpSelectionMode - the selection mode for this IDataBook.public boolean isInsertAllowed()
isInsertAllowed in interface IDataBookpublic boolean isInsertEnabled()
isInsertEnabled in interface IDataBookpublic void setInsertEnabled(boolean pInsertEnabled)
setInsertEnabled in interface IDataBookpInsertEnabled - true if insert is allowed on this IDataBook.
public boolean isUpdateAllowed()
throws ModelException
isUpdateAllowed in interface IDataBookModelException - if update is not possible because row access failed
public boolean isUpdateEnabled()
throws ModelException
isUpdateEnabled in interface IDataBookModelException - if update is not possible because row access failedpublic void setUpdateEnabled(boolean pUpdateEnabled)
setUpdateEnabled in interface IDataBookpUpdateEnabled - true if update is enabled on this IDataBook.public boolean isLockAndRefetchEnabled()
public void setLockAndRefetchEnabled(boolean pLockAndRefetchEnabled)
pLockAndRefetchEnabled - true if lock and refetch is enabled.
public boolean isDeleteAllowed()
throws ModelException
isDeleteAllowed in interface IDataBookModelException - if delete is not possible because row access failed
public boolean isDeleteEnabled()
throws ModelException
isDeleteEnabled in interface IDataBookModelException - if delete is not possible because row access failedpublic void setDeleteEnabled(boolean pDeleteEnabled)
setDeleteEnabled in interface IDataBookpDeleteEnabled - true if delete is enabled on this IDataBook.public boolean isReadonly()
isReadonly in interface IDataBook
public void setReadOnly(boolean pReadOnly)
throws ModelException
setReadOnly in interface IDataBookpReadOnly - true if this IDataBook is read only.
ModelException - if the DataBook cannot be set read only.public int getReadAhead()
public void setReadAhead(int pReadAheadRowCount)
pReadAheadRowCount - the row count to read ahead from the IDBAccesspublic boolean isOpen()
IDataBook is opened.
isOpen in interface IDataBookIDataBook is opened.
public void open()
throws ModelException
IDataBook. AbstractStorage oriented implementations should open
the storage (DB, XML, File) and load the Meta data/defaulting
the RowDefinition.
open in interface IDataBookModelException - if the IDataBook couldn't be opened, because of
empty storage unit name, empty IDataSource,
missing RowDefinition or failed DataPage creationpublic void close()
IDataBook. AbstractStorage oriented implementations should close
the storage (DB, XML, file).
close in interface IDataBook
public int getRowCount()
throws ModelException
getRowCount in interface IDataPageModelException - if a exception occurs during synchronize.
public int getSelectedRow()
throws ModelException
IDataBook.
getSelectedRow in interface IDataBookIDataBook or -1 if no row is selected.
ModelException - if a exception occurs during synchronize.
public void setSelectedRow(int pDataRowIndex)
throws ModelException
IDataBook.WriteBackIsolationLevel.DATA_ROW, the dataSource.storeAllDataBooks() method
needs to be called.IDataBook behavior.
setSelectedRow in interface IDataBookpDataRowIndex - the selected row index in the IDataBook.
ModelException - if the row with the iDataRowIndex couldn't get from the
storage
or if the IDataBook isn't open or the master
IDataBook has no selected row.
public String getSelectedColumn()
throws ModelException
IDataBook.
getSelectedColumn in interface IDataBookIDataBook.
ModelException - if a exception occurs during synchronize.
public void setSelectedColumn(String pColumnName)
throws ModelException
IDataBook.
setSelectedColumn in interface IDataBookpColumnName - the selected column in the IDataBook.
ModelException - if the column does not exist.
or if the IDataBook isn't open or the master
IDataBook has no selected row.public boolean isDeleteCascade()
isDeleteCascade in interface IDataBookpublic void setDeleteCascade(boolean pDeleteCascade)
setDeleteCascade in interface IDataBookpDeleteCascade - the value true means, delete the rows.
public int insert(boolean pBeforeRow)
throws ModelException
IDataRow. If bBeforeRow is true, it
will be inserted before the selected IDataRow, otherwise after
that.
insert in interface IDataBookpBeforeRow - specifies if the IDataRow is inserted before or after the
selected IDataRow
IDataRow is placed
ModelException - if the IDataRow can not be inserted or the ReferenceDefinition is wrong
or if not all changes could be written to the storage
(maybe implicit dataSource.storeAllDataBooks(), because of WritebackIsolationLevel
insert change the selected row implicit!)
public void update()
throws ModelException
update in interface IDataBookModelException - if problem with the locking in the storage happens.
public void delete()
throws ModelException
DataRow.
Events, if Detail DataBooks with rows exist:After the delete of the selected row is done, the IDataBookListener.AFTER_DELETING event is raised.
Before the delete each row is done, the IDataBookListener.BEFORE_DELETING event is raised.
After the delete each row is done, the IDataBookListener.AFTER_DELETING event is raised.
After the deletes all registered IControls get called the notifyRepaint() method.
delete in interface IDataBookModelException - if not all changes could be written to the storage
(maybe implicit save(), because of WritebackIsolationLevel)
public void deleteAllDataRows()
throws ModelException
DataRows.
deleteAllDataRows in interface IDataBookModelException - if not all changes could be written to the storage
(maybe implicit save(), because of WritebackIsolationLevel)IDataBook.setSelectedRow(int),
IDataBook.delete()public void notifyDetailChanged()
notifyDetailChanged in interface IDataBook
public IChangeableDataRow getDataRow(int pDataRowIndex)
throws ModelException
IDataRow of the specified index.
getDataRow in interface IDataPagepDataRowIndex - the index of the requested row
IDataRow of the specified index.
ModelException - if a exception occur during the fetch.
public IDataRow getOriginalRow()
throws ModelException
getOriginalRow in interface IChangeableDataRowgetOriginalRow in class ChangeableDataRowModelException - if original row couldn't determined
public boolean isWritableColumnChanged()
throws ModelException
isWritableColumnChanged in interface IChangeableDataRowisWritableColumnChanged in class ChangeableDataRowModelException - if writable column changed couldn't determined
public boolean isDeleting()
throws ModelException
isDeleting in interface IChangeableDataRowisDeleting in class ChangeableDataRowModelException - if is deleting couldn't determined
public boolean isUpdating()
throws ModelException
isUpdating in interface IChangeableDataRowisUpdating in class ChangeableDataRowModelException - if is updating couldn't determined
public boolean isInserting()
throws ModelException
isInserting in interface IChangeableDataRowisInserting in class ChangeableDataRowModelException - if is inserting couldn't determined
public boolean isDetailChanged()
throws ModelException
isDetailChanged in interface IChangeableDataRowisDetailChanged in class ChangeableDataRowModelException - if is detail changed couldn't determined
public Object getUID()
throws ModelException
IChangeableDataRow, which
isInserting().
getUID in interface IChangeableDataRowgetUID in class ChangeableDataRowIChangeableDataRow, which
isInserting().
ModelException - if UID couldn't determinedpublic ICondition getFilter()
IDataBook.
getFilter in interface IDataBookIDataBook.
public void setFilter(ICondition pFilter)
throws ModelException
IDataBook.ICondition's.
It stores first all changes, and then sets the new filter.
setFilter in interface IDataBookpFilter - the Filter with all ICondition's.
ModelException - if the IDataBook couldn't stored.IConditionpublic SortDefinition getSort()
IDataBook.
getSort in interface IDataBookIDataBook.
public void setSort(SortDefinition pSort)
throws ModelException
IDataBook.
setSort in interface IDataBookpSort - the sort order for this IDataBook
ModelException - if the IDataBook couldn't stored.SortDefinition
public void reload()
throws ModelException
IDataRow's in the IDataBook, like the was before the changes, get the data
again from the storage
It selects the same row (over primary key) if the SelectionMode == CURRENT_ROW in the IDataBook.
It selects the first row if the SelectionMode == FIRST_ROW in the IDataBook.
reload in interface IDataBookModelException - if an DataSourceException happens during get the requested row.
public void reload(IDataBook.SelectionMode pSelectionMode)
throws ModelException
IDataRow's in the IDataBook, like the was before the changes, get the data
again from the storage and selects the row with the specified SelectionMode.
It selects the same row (PK, ID) if the specified SelectionMode == CURRENT_ROW.
It selects the first row if the specified SelectionMode == FIRST_ROW.
reload in interface IDataBookpSelectionMode - the Selection mode to use
ModelException - if an DataSourceException happens during get the requested row.
public void reloadDataPage(IDataBook.SelectionMode pSelectionMode)
throws ModelException
pSelectionMode - pSelectionMode the Selection mode to use
ModelException - if an DataSourceException happens during get the requested row.reload(javax.rad.model.IDataBook.SelectionMode)
public void restoreSelectedRow()
throws ModelException
IDataRow, like the was before the changes.
restoreSelectedRow in interface IDataBookModelException - if an ModelException happens during undo the changes.
public void restoreAllRows()
throws ModelException
IDataRow's, like the was before the changes.
restoreAllRows in interface IDataBookModelException - if an ModelException happens during undo the changes.
public void restoreDataPage()
throws ModelException
ModelException - - if an ModelException happens during undo the changes.restoreAllRows()
public void saveSelectedRow()
throws ModelException
IDataRow.
saveSelectedRow in interface IDataBookModelException - if an ModelException happens during store operation.
public void saveDataPage()
throws ModelException
saveDataPage in interface IDataBookModelException - if saveSelected() fails
public void saveAllRows()
throws ModelException
IDataRow's to the IDataSource.
saveAllRows in interface IDataBookModelException - if an ModelException happens during store operation.public boolean isOutOfSync()
isOutOfSync in interface IDataBook
public boolean isAllFetched()
throws ModelException
isAllFetched in interface IDataPageModelException - if the DataBook isn't open
public void fetchAll()
throws ModelException
IDataRow's from the storage.
fetchAll in interface IDataPageModelException - if an DataSourceException happens during get all rows
public IDataRow getMasterDataRow()
throws ModelException
getMasterDataRow in interface IDataPageModelException - if a exception occurs during synchronize.public void addDetailDataBook(IDataBook pDetailDataBook)
addDetailDataBook in interface IDataBookpDetailDataBook - the detail DataBook to usepublic void removeDetailDataBook(IDataBook pDetailDataBook)
removeDetailDataBook in interface IDataBookpDetailDataBook - the detail IDataBook to usepublic IDataBook[] getDetailDataBooks()
IDataBooks to the master IDataBook.
getDetailDataBooks in interface IDataBookIDataBooks to the master IDataBook.
public int[] getOnlyIUDChangedDataRows()
throws ModelException
ModelException - if the changed rows couldn't determined.
public int[] getChangedDataRows()
throws ModelException
getChangedDataRows in interface IDataPageModelException - if a exception occurs during synchronize.
public IDataPage getDataPage(IDataRow pMasterDataRow)
throws ModelException
IDataPage to specified master row
from the master DataBook. If it doesn't exists, it will be created
and returned.
getDataPage in interface IDataBookpMasterDataRow - the master IDataRow of the master DataBook.
IDataPage to specified master row
from the master DataBook.
ModelException - if the pMasterRow don't contains the master columns from the master
ReferenceDefinition
public boolean hasDataPage(IDataRow pMasterDataRow)
throws ModelException
IDataPage to specified master row
from the master DataBook exists.
hasDataPage in interface IDataBookpMasterDataRow - the master IDataRow of the master DataBook.
IDataPage to specified master row
from the master DataBook exists.
ModelException - if the pMasterRow don't contains the master columns from the master
ReferenceDefinition
public boolean hasDataPage(IDataRow pRootDataRow,
TreePath pTreePath)
throws ModelException
IDataPage to specified root row and TreePath
from the master DataBook exists.
pRootDataRow - the root IDataRow of the DataBook to check.pTreePath - the TreePath to use.
IDataPage to specified root row and TreePath
from the master DataBook exists.
ModelException - if the pRootDataRow don't contains the root columns from the DataBook.public DataBookHandler eventBeforeRowSelected()
eventBeforeRowSelected in interface IDataBookpublic DataBookHandler eventAfterRowSelected()
eventAfterRowSelected in interface IDataBookpublic DataBookHandler eventBeforeInserting()
eventBeforeInserting in interface IDataBookpublic DataBookHandler eventAfterInserting()
eventAfterInserting in interface IDataBookpublic DataBookHandler eventBeforeInserted()
eventBeforeInserted in interface IDataBookpublic DataBookHandler eventAfterInserted()
eventAfterInserted in interface IDataBookpublic DataBookHandler eventBeforeUpdating()
eventBeforeUpdating in interface IDataBookpublic DataBookHandler eventAfterUpdating()
eventAfterUpdating in interface IDataBookpublic DataBookHandler eventBeforeUpdated()
eventBeforeUpdated in interface IDataBookpublic DataBookHandler eventAfterUpdated()
eventAfterUpdated in interface IDataBookpublic DataBookHandler eventBeforeDeleting()
eventBeforeDeleting in interface IDataBookpublic DataBookHandler eventAfterDeleting()
eventAfterDeleting in interface IDataBookpublic DataBookHandler eventBeforeDeleted()
eventBeforeDeleted in interface IDataBookpublic DataBookHandler eventAfterDeleted()
eventAfterDeleted in interface IDataBookpublic DataBookHandler eventBeforeRestore()
eventBeforeRestore in interface IDataBookpublic DataBookHandler eventAfterRestore()
eventAfterRestore in interface IDataBookpublic DataBookHandler eventBeforeReload()
eventBeforeReload in interface IDataBookpublic DataBookHandler eventAfterReload()
eventAfterReload in interface IDataBookpublic DataBookHandler eventBeforeColumnSelected()
eventBeforeColumnSelected in interface IDataBookpublic DataBookHandler eventAfterColumnSelected()
eventAfterColumnSelected in interface IDataBook
public int searchNext(ICondition pCondition)
throws ModelException
searchNext in interface IDataPagepCondition - the condition.
ModelException - if a ModelException occurs.
public int searchNext(ICondition pCondition,
int pRowNum)
throws ModelException
searchNext in interface IDataPagepCondition - the condition.pRowNum - the starting row.
ModelException - if a ModelException occurs.
public int searchPrevious(ICondition pCondition)
throws ModelException
searchPrevious in interface IDataPagepCondition - the condition.
ModelException - if a ModelException occurs.
public int searchPrevious(ICondition pCondition,
int pRowNum)
throws ModelException
searchPrevious in interface IDataPagepCondition - the condition.pRowNum - the starting row.
ModelException - if a ModelException occurs.public int getRowIndex()
IDataRows in the IDataPage.
That returns != -1 only if the IDataRow is from a IDataPage
getRowIndex in interface IChangeableDataRowgetRowIndex in class ChangeableDataRowIDataRows in the IDataPage.public IDataPage getDataPage()
IDataPage of the IDataRow.
That returns != null only if the IDataRow is from a IDataBook
getDataPage in interface IChangeableDataRowgetDataPage in class ChangeableDataRowIDataPage of the IDataRow.
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
public Object getValue(String pColumnName)
throws ModelException
getValue in interface IDataRowgetValue in class DataRowpColumnName - the name of the column
ModelException - if the ColumnDefinition name is not in this IDataRow
public void setValue(String pColumnName,
Object pValue)
throws ModelException
IDataRow.
setValue in interface IDataRowsetValue in class DataRowpColumnName - the column namepValue - the new value for the column in this IDataRow
ModelException - if the ColumnDefinition name is not in this IDataRow
or the pValue is not convertible/too large to/for the IDataType
of the column
public Object[] getValues(String[] pColumnNames)
throws ModelException
IDataRow.
getValues in interface IDataRowgetValues in class DataRowpColumnNames - a String[] of column names
IDataRow
ModelException - if the ColumnDefinition name is not in this IDataRow
public void setValues(String[] pColumnNames,
Object[] pValues)
throws ModelException
Object[]
to the this IDataRow.String[].
setValues in interface IDataRowsetValues in class DataRowpColumnNames - a String[] of column namespValues - a Object[] of values to set in the corresponding columns of the IDataRow
ModelException - if the ColumnDefinition name is not in this IDataRow
or the pValue is not convertible/too large to/for the DataType
of the columnpublic String toString()
toString in class ChangeableDataRowprotected MemDataPage createDataPage(IDataRow pMasterDataRow)
pMasterDataRow - the master IDataRow for this IDataPage.
protected boolean isMemSort()
protected void setMemSort(boolean pMemSort)
pMemSort - true if the sort is handled in memory.protected boolean isMemFilter()
protected void setMemFilter(boolean pMemFilter)
pMemFilter - true if the filter is handled in memory.protected boolean isWritebackEnabled()
protected void setWritebackEnabled(boolean pWritebackEnabled)
pWritebackEnabled - determines if changes should be written to the store.
public int getEstimatedRowCount()
throws ModelException
IDBAccess for this RemoteDataBook.
ModelException - the the detail DataBook couldn't synchronized with the master DataBook
protected void executeInsert()
throws ModelException
ModelException - if an ModelException occur during insert.
protected void executeUpdate()
throws ModelException
ModelException - if an ModelException occur during update.
protected void executeDelete()
throws ModelException
ModelException - if an ModelException occur during delete.
protected void executeLockAndRefetch()
throws ModelException
ModelException - if an ModelException occur during insert.
protected void executeRefresh()
throws ModelException
ModelException - if an ModelExcpetion happen during refreshprotected void clear()
protected void setSelectedRowInternal(int pDataRowIndex)
throws ModelException
pDataRowIndex - the new row index to use.
ModelException - if new row couldn't determined or selected.
protected void setValuesInternal(String[] pColumnNames,
Object[] pValues)
throws ModelException
pColumnNames - the column names to use.pValues - the values to use
ModelException - if the value couldn't set into the memory.
protected void store()
throws ModelException
store in class ChangeableDataRowModelException - if a ModelException occurs.
protected void clearFilterSortInMemDataPages()
throws ModelException
ModelException - if a ModelException occurs.public void setReadOnlyWithoutSave(boolean pReadOnly)
pReadOnly - true to set the databook readonly, false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||