javax.rad.persist
Interface IStorage

All Known Subinterfaces:
ICachedStorage
All Known Implementing Classes:
AbstractCachedStorage, AbstractMemStorage, AbstractStorage, DBStorage

public interface IStorage

The IStorage defines the methods to access any kind of table oriented storage: e.g. a database, XML file, ...


Method Summary
 void delete(Object[] pDeleteDataRow)
          Deletes the specified row from the storage.
 List<Object[]> fetch(ICondition pFilter, SortDefinition pSort, int pFromRow, int pMinimumRowCount)
          Returns the requested rows as List[Object[]].
 int getEstimatedRowCount(ICondition pFilter)
          Returns the number of rows in this AbstractStorage from the storage.
 MetaData getMetaData()
          Returns the meta data for this AbstractStorage from the storage as MetaData.
 Object[] insert(Object[] pDataRow)
          Returns the newly inserted row for this IStorage.
 Object[] refetchRow(Object[] pDataRow)
          It refetchs the specified row and returns it as Object[] from the storage.
 Object[] update(Object[] pOldDataRow, Object[] pNewDataRow)
          Return the updated row as Object[].
 

Method Detail

getMetaData

MetaData getMetaData()
                     throws DataSourceException
Returns the meta data for this AbstractStorage from the storage as MetaData.

Returns:
the meta data for this AbstractStorage from the storage as MetaData.
Throws:
DataSourceException - if an Exception occur during getting the meta data from the storage.

getEstimatedRowCount

int getEstimatedRowCount(ICondition pFilter)
                         throws DataSourceException
Returns the number of rows in this AbstractStorage from the storage.
It consider the specified ICondition to count the rows.

Parameters:
pFilter - the ICondition to use.
Returns:
the number of rows in this AbstractStorage from the storage.
Throws:
DataSourceException - if an Exception occur during interacting with the storage.

fetch

List<Object[]> fetch(ICondition pFilter,
                     SortDefinition pSort,
                     int pFromRow,
                     int pMinimumRowCount)
                     throws DataSourceException
Returns the requested rows as List[Object[]]. Optimization can also return more then the minimum row count. If possible all in a certain time.

Parameters:
pFilter - the ICondition to use.
pSort - the SortDefinition to use.
pFromRow - the from row index to request from storage.
pMinimumRowCount - the minimum row count to request, beginning from the pFromRow.
Returns:
the requested rows as List[Object[]].
Throws:
DataSourceException - if an Exception occur during interacting with the storage.

refetchRow

Object[] refetchRow(Object[] pDataRow)
                    throws DataSourceException
It refetchs the specified row and returns it as Object[] from the storage.
Before the user starts editing in the GUI, the IDataRow in the storage should be locked for updates.

Parameters:
pDataRow - the specified row as Object[].
Returns:
the refetched row as Object[].
Throws:
DataSourceException - if an Exception occur during interacting with the storage.

insert

Object[] insert(Object[] pDataRow)
                throws DataSourceException
Returns the newly inserted row for this IStorage.

Parameters:
pDataRow - the new row as Object[] to insert.
Returns:
the newly inserted row from this IStorage.
Throws:
DataSourceException - if an Exception occur during insert the row to the storage

update

Object[] update(Object[] pOldDataRow,
                Object[] pNewDataRow)
                throws DataSourceException
Return the updated row as Object[].

Parameters:
pOldDataRow - the old row as Object[]
pNewDataRow - the new row as Object[] to update
Returns:
the updated row as Object[].
Throws:
DataSourceException - if an Exception occur during updating the row.

delete

void delete(Object[] pDeleteDataRow)
            throws DataSourceException
Deletes the specified row from the storage.

Parameters:
pDeleteDataRow - the row as Object[] to delete.
Throws:
DataSourceException - if an Exception occur during deleting the row or if the storage isn't opened or the PrimaryKey is wrong and more/less then one row is deleted.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.