Re: Multiple Self - joins
Re: Multiple Self - joins
- Subject: Re: Multiple Self - joins
- From: Chuck Hill <email@hidden>
- Date: Wed, 12 Jan 2005 11:50:22 -0800
You should not need a separate entity, just a FK attribute to define
parent./children.
On Jan 12, 2005, at 11:47 AM, Florijan Stamenkovic wrote:
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:
village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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