ftp.nice.ch/pub/next/developer/objc/dbkit/AssociationExample.README

This is the README for AssociationExample.92.9.s.tar.gz [Download] [Browse] [Up]

AssociationExample
by Mai Nguyen, NeXT Developer Support Team

Overview

The current version of DBKit does not provide a way to filter the records fetched by a detail FetchGroup. DBKit does not allow a qualifier to be built into a relationship, nor does it allow a qualifier to be permanently attached to a FetchGroup. The Association example provides a way to do filtering of detail records by using a subclass of DBAssociation that replaces the default association which exists between the master FetchGroup and the detail FetchGroup. In this example, the user can change the criteria of the qualifier by entering a new value in the salary field and pressing the Fetch: button. The example is built such that you can easily reuse the object QualifiedAssociation in your custom application.
In order to run this example, you need to install the OracleDemo.dbmodel which resides in /NextDeveloper/Examples/DatabaseKit/Models into your ~/Library/Databases directory. You can also easily reuse this code for any model you create yourself.

Program Organization

Major Classes in the Application

 
Controller	A general tester object.  This object is for testing whether the custom association works 	properly. It is managing the UI of this example.

 QualifiedAssocition	A subclass of  DBAssociation. It overrides the method called when fetching, and add some new methods for setting up the proper qualifier. 
 

Other Peculiarities
In order to load an Adaptor dynamically, you need to add the OTHER_LDFLAGS definition (see the Makefile.preamble). You also need to add the libdbkit_s.a library into your PB.project under libraries in order to use the DBKit API. 

Topics Of Interest

- How to set up a new DBAssociation between the master fetchgroup and the detail fetchgroup 
See the C function  setUpAssociaiton() in the file QualifiedAssociation.m.

Last Edited: September 1992

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.