SilverStream
Application Server 3.5

com.sssw.rt.util
Interface AgiDataUpdateRequest

All Known Implementing Classes:
AgoDataUpdateRequest

public interface AgiDataUpdateRequest

Abstraction of an in-progress update request on one or more data sources. The update request gathers inserted/modified/deleted rows, and then atomically (or as atomically as possible, if the rows span multiple databases), executes the updates against the database. It's legal to close the update request with outstanding updates, in which case the pending updates are discarded. This is a part of the low-level API for accessing and updating row-based data sources; see AgiDataSource for more information.

Ordinarily, most data source implementors will not provide their own implementation "from scratch" of the AgiDataUpdateRequest interface; instead, they will provide a class that extends the abstract class AgoDataUpdateRequest, which performs the mechanics of handling the update rows.

See Also:
AgiDataSource, AgiDataRow, AgoDataUpdateRequest

Method Summary
 void close()
          Close the update request, discarding any pending changes.
 void deleteRow(AgiDataSource dataSource, AgiDataRow row)
          Delete the specified data row for the specified data source.
 Enumeration executeAllUpdates()
          Execute the updates as atomically as possible.
 void insertRow(AgiDataSource dataSource, AgiDataRow row)
          Insert the specified data row for the specified data source.
 void makePrimaryRow(AgiDataSource dataSource, AgiDataRow row)
          Make the specified data row the primary version for the specified data source.
 void updateRow(AgiDataSource dataSource, AgiDataRow oldRow, AgiDataRow newRow)
          Update the specified data row for the specified data source.
 

Method Detail

insertRow

public void insertRow(AgiDataSource dataSource,
                      AgiDataRow row)
               throws AgoApiException
Insert the specified data row for the specified data source. The data source should be of the same type as the data source which created this update request.
Parameters:
dataSource - The data source for the row
row - The data row to be inserted

deleteRow

public void deleteRow(AgiDataSource dataSource,
                      AgiDataRow row)
               throws AgoApiException
Delete the specified data row for the specified data source. The data source should be of the same type as the data source which created this update request.
Parameters:
dataSource - The data source for the row
row - The data row to be inserted

updateRow

public void updateRow(AgiDataSource dataSource,
                      AgiDataRow oldRow,
                      AgiDataRow newRow)
               throws AgoApiException
Update the specified data row for the specified data source. The data source should be of the same type as the data source which created this update request. The oldRow identifies the row being updated, while the newRow contains the new and/or changed values.

Note that the newRow will be sparse -- that is, only columns that were modified by the client are present.

Parameters:
dataSource - The data source for the row
oldRow - The old values of the data row to be updated
newRow - The new values of the data row to be updated

makePrimaryRow

public void makePrimaryRow(AgiDataSource dataSource,
                           AgiDataRow row)
                    throws AgoApiException
Make the specified data row the primary version for the specified data source. The data source should be of the same type as the data source which created this update request.
Parameters:
dataSource - The data source for the row
row - The data row to be made primary

close

public void close()
Close the update request, discarding any pending changes.

executeAllUpdates

public Enumeration executeAllUpdates()
                              throws AgoApiException
Execute the updates as atomically as possible. Returns an enumeration of the rows whose values were altered during the update (e.g. autoincrement rows, or rows modified by a default value expression). Each row in the enumeration should have been created using the AgiDataRowFactory associated with the data source it came from.
Returns:
Enumeration of modified rows (AgiDataRow)
Throws:
AgoApiException - if the update fails.

SilverStream
Application Server 3.5