Many to Many with an ordered join table
Many to Many with an ordered join table
- Subject: Many to Many with an ordered join table
- From: Charles Young <email@hidden>
- Date: Thu, 7 May 2009 17:20:35 -0700
Hi
I'm sure I have a commonly seen issue:
I have a many to many relationship between tables SOURCE and DEST.
This is implemented by a third table GLUE which contains the PKs of
SOURCE and DEST as well as an integer property (order) that describes
the order of DESTs with respect to SOURCE.
I'd like to flatten the relationship such that I can call a method like:
source.dests() -> NSArray <Dest>
where the array is ordered by source.glue.order().
I've written a simple method that grabs source.glue(), sorts it on
glue.order() and then iterates to extract dest, but I'm sure this
issue has been solved many, many times before in a cleaner and more
elegant manner.
On a separate subject thanks to all for a very interesting and
informative group. I've been lurking for some time and have been
enjoying the various conversations.
Cheers,
Charles
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden