Re: Reflexive Many-To-Many won't budge
Re: Reflexive Many-To-Many won't budge
- Subject: Re: Reflexive Many-To-Many won't budge
- From: Lachlan Deck <email@hidden>
- Date: Wed, 17 Oct 2007 10:42:16 +1000
On 17/10/2007, at 9:25 AM, Art Isbell wrote:
On Oct 16, 2007, at 12:13 PM, Fred Wells wrote:
I am trying to get a reflexive many to many relationship to work
and it won't budge. I have read through all of th previous
postings on this and nothing gives an definitive answer on this
and my attempts to follow what had been put up still hasn't worked
for me. When trying to add to the relationship through
addObjectsToBoth... I get this error with one side of the
relationship:
java.lang.IllegalStateException: A valid global ID could not be
obtained for entity named TaskToTask, relationship named
previousTasks, primary key dictionary {previousTaskPkid = 4; }.
at
com.webobjects.eoaccess.EODatabaseContext.databaseOperationForInterme
diateRowFromSourceObject(EODatabaseContext.java:5061)
at
com.webobjects.eoaccess.EODatabaseContext.recordInsertForIntermediate
RowFromSourceObject(EODatabaseContext.java:5077)
at
com.webobjects.eoaccess.EODatabaseContext.relayAttributesInRelationsh
ipSourceObjectDestinationObject(EODatabaseContext.java:5103)
I filed a WO 5.2.3 bug report that included the identical exception
and backtrace. In my case, the many-to-many reflexive relationship
was in an abstract base entity in a vertical inheritance scheme
with the join entity abstract as well. When I tried to create a
new many-to-many relationship in a concrete derived entity, the
exception was thrown. But when the many-to-many reflexive
relationship was defined in a concrete derived entity instead of in
the abstract base entity, no exception was thrown. Also, using
single-table rather than vertical inheritance worked correctly.
But you didn't mention inheritance, so maybe your situation is
totally different.
If it is indeed vertical inheritance, the rule of thumb I've found to
work (until the bug is fixed) is as follows:
"mark every inherited foreign key as a class attribute in each sub-
entity"
with regards,
--
Lachlan Deck
_______________________________________________
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