Re: Many to Many self join
Re: Many to Many self join
- Subject: Re: Many to Many self join
- From: Art Isbell <email@hidden>
- Date: Wed, 26 Jan 2005 11:17:12 -1000
On Jan 26, 2005, at 10:30 AM, David Holt wrote:
Now the client has realized that there can be multiple "next" images
AND multiple "previous" images. I have spent the morning trying to
model this relationship and I have come up with the image table
related to a join table (prevnextImage). I have put two columns on the
join table: fk_previmage_ID and fk_nextimage_ID and I have a to-one
relationship from each to the image_ID on the image table. I have two
many to many from image.image_ID to the join table columns. I have
flattened the relationships to the previous and next images.
Basically, you want a configuration identical to that which EOModeler
would build for a many-to-many relationship. The descriptions sound
correct. Ensure that only the flattened relationships are class
properties; i.e., none of the to-one and to-many relationships should
be class properties. Also, ensure that the relationship properties are
correct. The to-one relationships should be optional with a nullify
delete rule. The to-many relationships should be optional with a
cascade delete rule. The to-many relationships should be configured to
propagate the primary key.
When I add an image to the database and specify a previous image, I
get the following error:
[2005-01-26 11:52:55 PST] <WorkerThread6>
java.lang.IllegalStateException: A valid global ID could not be
obtained for entity named prevnextimage, relationship named
prevImages_previmage, primary key dictionary {fk_previmage_ID = 1; }.
at
com.webobjects.eoaccess.EODatabaseContext.databaseOperationForIntermedi
ateRowFromSourceObject(EODatabaseContext.java:5033)
I have experienced this exception when I attempted to model a
many-to-many reflexive relationship on a base class in a vertical
inheritance scheme. I believe this was due to a WO bug. When I
changed to a single-table inheritance scheme, the exception was no
longer thrown.
Aloha,
Art
_______________________________________________
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