On 21/09/2007, at 11:40 AM, Klaus Berkling wrote:

I hope someone has thoughts on performing a search through a hierarchical data model.

I have a WO application that receives, stores and retrieves student study information. More here:
http://www.dyned.com/products/internetrm.shtml

In my model I have a group entity which have sub-groups via one-to- many relationship back to itself.

Let's call this type 'Category'.

These groups then have classes with students. There is a class entity with many-to-many relationships to the student entity.

Let's call the join table 'Enrolment'
(this is sounding familiar, with some minor diffs :)

There is a search I need to implement that returns matching groups, classes and students within a givem parent group.

1. matching groups/categories are easily resolved by working back from matching classes. e.g.,
NSSet classesResultSet; // assume exists
NSSet matchingGroups = new NSSet( ( NSArray ) classesResultSet.allObjects().valueForKey( Klass.CategoryKey ) );

2. resolving matching classes or students depends on the search criteria... i.e., what determines the result set? Is it based on particular types of students, day or week, etc? Are the studends filtered by the resulting classes or vice versa?

i.e., if you can break it down a bit more a build an appropriate qualifier for the either classes or students...

I can reach all the objects through relationships so starting with a parent group I can walk through all the sub-groups, classes and students arrays. This is time consuming.

Indeed. You'll want to create a qualifier and ensure you've got good indexing happening.

I'm trying to think of a fetch specification that avoids some of the recursive looping I do now.

See above.

with regards,
--

Lachlan Deck



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to