PATH  WebObjects 4.0 Documentation > SybaseEOAdaptor Reference



SybaseChannel.Delegate

SybaseChannel delegate objects

Inherits From:
com.apple.yellow.sybaseeoadaptor

SybaseChannel's delegate methods used for processing compute rows and stored procedures give you access to the three types of non-regular rows supported by Sybase: compute rows, return parameters (from a stored procedure), and status from a stored procedure. Because the access layer can only handle regular table rows, the Sybase adaptor channel normally skips non-regular rows. However, you can use the delegate methods to intercept non-regular rows before they are skipped. These delegate methods are sybaseChannelWillFetchAttributes and sybaseChannelWillReturnRow. The method sybaseChannelWillFetchAttributes is invoked when a row is fetched, while sybaseChannelWillReturnRow is invoked when a row is about to be returned. Based on the type of the row, the delegate can specify the appropriate behavior. This enables you to use data in one of the three non-regular row types and either extract the data from them or use the method describeResults to return an array of attributes that describe the properties available in the current result set. Using describeResults is appropriate if you're not concerned with format-for example, if you're just writing raw data to a report.

Note: The regular rows in the results from a stored procedure must map to the attributes in the corresponding entity, and must be in alphabetical order.

The SybaseChannel adaptor defines the following constants against which you can compare the returned row type:


Instance Methods


sybaseChannelWillFetchAttributes

public abstract NSArray sybaseChannelWillFetchAttributes(SybaseChannel channel,
NSArray attributes,
int rowType,
int computeRowId)

Invoked whenever a row is fetched. The delegate can return null, which causes the row to be skipped, or can return a substitute set of attributes that is appropriate for the type of row being fetched. Delegates can have the channel fabricate a set of attributes for the current non-regular row by calling describeResults. See the interface introduction for a list of defined constants for rowType.


sybaseChannelWillReturnRow

public abstract boolean sybaseChannelWillReturnRow(SybaseChannel channel,
NSDictionary row,
int rowType,
int computeRowId)

Invoked once a row has been read from the database and packaged into the dictionary. Delegates can return true to cause the row to be returned from fetchAttributes, or they can return false to cause the row to be skipped. See the interface introduction for a list of defined constants for rowType.





Copyright © 1998, Apple Computer, Inc. All rights reserved.