Re: Inheritance and stale relationship
Re: Inheritance and stale relationship
- Subject: Re: Inheritance and stale relationship
- From: Ken Anderson <email@hidden>
- Date: Thu, 2 Aug 2007 08:37:33 -0400
On Aug 2, 2007, at 6:19 AM, Denis Frolov wrote:
Article is a child entity of OfficeItem (using horizontal
inheritance here)
Office.officeItems <-->> OfficeItem
Office.articles <-->> Article
1. I create a new Article object and add it to both sides of
Office.officeItems relationship.
2. Office.officeItems relationship is updated as expected and I can
see new Article object there.
3. Office.articles relationship is not updated and I cannot see new
Article there.
I've noticed, that sometimes Office.articles does get updated, but
I haven't yet found the reason why. I seem to be doing the same
steps to reproduce the problem but am getting different results.
Any clues? What part of EOF is supposed to update Office.articles
relationship?
None.
You are doing something that EOF doesn't expect - having
relationships that reference a super-entity and a sub-entity. The
only way this would really work is if you add your object to both
sides of both relationships.
The reason you're seeing unpredictable behavior is because, if the
articles relationship hasn't been faulted yet, EOF will go to the
database and end up fetching the same object that you originally
attached to the officeItems relationship.
I would strong think about why you need to have 2 such
relationships. A better solution would be to have the officeItems
relationship, then have a method that creates a new array for
articles whenever you need them.
Ken
--
Denis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com
This email sent to email@hidden
_______________________________________________
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