Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Common Delegate Usage

Note: This section is intended for experts.

A number of control points are provided that let you customize fetch operations in Enterprise Objects applications. Table 6-2 lists the delegate methods in EODatabaseContext that you can use to customize fetch operations.

You can set the delegate of EODatabaseContext by invoking the class method EODatabaseContext.setDefaultDelegate.

Table 5-2  EODatabaseContext delegate methods

Method

Description

databaseContextShouldSelectObjects

Invoked just before a SELECT operation occurs. Use this delegate method to return false to tell the adaptor channel to skip the SELECT. You might want to do this to issue your own custom SQL to the adaptor.

databaseContextShouldUsePessimisticLock

Use this delegate method to selectively turn off the locking of rows when you’re using a pessimistic locking strategy.

databaseContextDidSelectObjects

Invoked immediately after a SELECT operation occurs. You can use it to log diagnostic information or initialize internal state for subsequent fetches.

databaseContextShouldFetchObjects

Use this method to satisfy an editing context’s fetch request from its snapshot cache.

databaseContextDidFetchObjects

Invoked after an EODatabaseContext fetches objects. Use it to record in a local cache the results of a fetch.

databaseContextFailedToFetchObject

Invoked when a to-one fault cannot find its data in the database. Use this method to immediately throw an exception.

databaseContextShouldLockObjectWithGlobalID

Invoked from lockObjectWithGlobalID. Use it to implement custom locking.

databaseContextShouldRaiseExceptionForLockFailure

Use this method to suppress an exception that occurs when EODatabaseContext attempts to lock an object.

databaseContextShouldUpdateCurrentSnapshot

Invoked when an EODatabaseContext already has a snapshot for a row fetched from the database. Use it to compare the snapshots and possibly resolve conflicts.



< Previous PageNext Page > Hide TOC


Last updated: 2007-07-11




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice