Many to Many self join
Many to Many self join
- Subject: Many to Many self join
- From: David Holt <email@hidden>
- Date: Wed, 26 Jan 2005 12:30:04 -0800
Hello,
So the client has upped the ante again :-) ! I am still working on the
component that displays images and links to other images. With Chuck's
help I had simple self-join relationships using next, previous, parent
and child images. 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.
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.databaseOperationForIntermedia
teRowFromSourceObject(EODatabaseContext.java:5033)
at
com.webobjects.eoaccess.EODatabaseContext.recordInsertForIntermediateRow
FromSourceObject(EODatabaseContext.java:5049)
at
com.webobjects.eoaccess.EODatabaseContext.relayAttributesInRelationshipS
ourceObjectDestinationObject(EODatabaseContext.java:5075)
at
com.webobjects.eoaccess.EODatabaseContext.relayAttributesInRelationshipS
ourceObjectDestinationObjects(EODatabaseContext.java:5129)
at
com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContext(
EODatabaseContext.java:6175)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingCo
ntext(EOObjectStoreCoordinator.java:408)
at com.webobjects.eocontrol.EOEditingContext.saQuery "SELECT PK FROM
EO_PK_TABLE WHERE NAME = 'ProcessImage' FOR UPDATE" execution time: 7
Does anyone have any idea what I might be doing wrong?
Thanks,
David
_______________________________________________
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