Multiple Self - joins
Multiple Self - joins
- Subject: Multiple Self - joins
- From: Florijan Stamenkovic <email@hidden>
- Date: Wed, 12 Jan 2005 20:47:36 +0100
Yes, I think I understand what you need.
To set up a to-many relationship to the same table (a self join) you
need to make another entity for the linking. That entity must have two
attributes defined as primary keys. They should both look the same as
you primary key in the table where you want the joins. Then you set up
a to many relationship from your original table to one of the keys in
the second (helping entity). Then you set up a to-one relationship from
the second identity to the primary key in the first identity. Then you
go to your second identity and flatten the to-one relationship in it
into your first entity. Effectively you will end up with a to-many
relationship in the first entity but referring to the records in the
same entity. You will never instantiate the second entity by hand, so
you should hide it. It has to be there to provide the mechanism though.
Contact me if you i wasn't clear enough. I know this works because I
just used it.
Best regards,
Florijan
_______________________________________________
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