PATH
Documentation > WebObjects 4.5 >
EOAccess Reference
(informal protocol)
Declared in: EOAccess/EOAdaptorChannel.h
Protocol Description
EOAdaptorChannel sends messages to its delegate for nearly
every operation that would affect data in the database server. The
delegate can use these methods to preempt these operations, modify
their results, or simply track activity.
Instance Methods
- (void)adaptorChannelDidChangeResultSet:(id)channel
Invoked from fetchRowWithZone: when
a select operation resulted in multiple result sets. This method tells
the delegate that the next invocation of fetchRowWithZone: will
fetch from the next result set. This method is invoked when fetchRowWithZone: returns nil and there
are still result sets left to fetch. The delegate can invoke setAttributesToFetch: to
prepare for fetching the new rows.
- (void)adaptorChannel:(id)channel
didEvaluateExpression:(EOSQLExpression
*)expression
Invoked from evaluateExpression: to
tell the delegate that a query language expression has been evaluated
by the database server.
- (void)adaptorChannel:(id)channel
didExecuteStoredProcedure:(EOStoredProcedure
*)procedure
withValues:(NSDictionary *)values
Invoked from executeStoredProcedure:withValues: after procedure is
executed successfully.
- (void)adaptorChannel:(id)channel
didFetchRow:(NSMutableDictionary
*)row
Invoked from fetchRowWithZone: after
a row is fetched successfully. This method is not invoked if an exception
occurs during the fetch or if the same returns nil because there
are no more rows in the current result set. The delegate may modify row,
which will be returned from fetchRowWithZone:.
- (void)adaptorChannelDidFinishFetching:(id)channel
Invoked from fetchRowWithZone: to
tell the delegate that fetching is finished for the current select operation.
This method is invoked when a fetch ends in fetchRowWithZone: because
there are no more result sets.
- (NSException *)adaptorChannel:(id)channel
didPerformOperations:(NSArray
*)operations
exception:(NSException *)exception
Invoked from performAdaptorOperations:. exception is nil if
no exception was raised while operations were
performed. Otherwise, exception is
the raised exception. The delegate can return the same or a different
exception, which is re-raised by performAdaptorOperations:,
or it can return nil to prevent the adaptor channel from raising
an exception.
- (void)adaptorChannel:(id)channel
didSelectAttributes:(NSArray *)attributes
fetchSpecification:(EOFetchSpecification
*)fetchSpecification
lock:(BOOL)flag
entity:(EOEntity *)entity
Invoked from selectAttributes:fetchSpecification:lock:entity: to
tell the delegate that rows have been selected in the database server.
- (NSDictionary *)adaptorChannelShouldConstructStoredProcedureReturnValues:(id)channel
Invoked from returnValuesForLastStoredProcedureInvocation to
tell the delegate that channel is constructing
return values for the last stored procedure evaluated. If the delegate
returns a value other than nil, that value will be returned immediately
from returnValuesForLastStoredProcedureInvocation.
- (BOOL)adaptorChannel:(id)channel
shouldEvaluateExpression:(EOSQLExpression
*)expression
Invoked from evaluateExpression: to
tell the delegate that channel is
sending an expression to the database server. The delegate returns YES to
permit the adaptor channel to send expression to
the server. If the delegate returns NO, the adaptor channel does
not send the expression and returns immediately. When the delegate
returns NO, the adaptor channel expects that the implementor of
the delegate has done the work that evaluateExpression: would
have done. The delegate can create a new EOSQLExpression and send
the expression itself before returning NO.
- (NSDictionary *)adaptorChannel:(id)channel
shouldExecuteStoredProcedure:(EOStoredProcedure
*)procedure
withValues:(NSDictionary *)values
Invoked from executeStoredProcedure:withValues: to
tell the delegate that channel is
executing a stored procedure. If the delegate returns a value other
than nil, that value is used as the arguments to the stored procedure
instead of values.
- (NSDictionary *)adaptorChannel:(id)channel
shouldReturnValuesForStoredProcedure:(NSDictionary
*)returnValues
Invoked from returnValuesForLastStoredProcedureInvocation to
tell the delegate that channel is returning
values for a stored procedure. If the delegate returns a value other
than nil, that value is returned from returnValuesForLastStoredProcedureInvocation instead
of returnValues.
- (BOOL)adaptorChannel:(id)channel
shouldSelectAttributes:(NSArray
*)attributes
fetchSpecification:(EOFetchSpecification
*)fetchSpecification
lock:(BOOL)flag
entity:(EOEntity *)entity
Invoked from selectAttributes:fetchSpecification:lock:entity: to
ask the delegate whether a select operation should be performed.
The delegate should not modify fetchSpecification. Instead, if the delegate
wants to perform a different select it should invoke selectAttributes:fetchSpecification:lock:entity: itself
with a new fetch specification, and return NO (indicating that the
adaptor channel should not perform the select itself).
- (void)adaptorChannelWillFetchRow:(id)channel
Invoked from fetchRowWithZone: to
tell the delegate that a single row will be fetched. The delegate
can determine the attributes used by the fetch by sending attributesToFetch to channel,
and can change the set of attributes to fetch by sending setAttributesToFetch: to channel.
The adaptor channel performs the actual fetch.
- (NSArray *)adaptorChannel:(id)channel
willPerformOperations:(NSArray
*)operations
Invoked from performAdaptorOperations: to
tell the delegate that channel is
performing the EOAdaptorOperations in operations.
The delegate may return operations or
a different NSArray for the adaptor channel to perform. If the delegate
returns nil, the adaptor channel does not perform the operations
and returns from the method immediately.