Re: Re: Flattened relationship and iterator oddness
Re: Re: Flattened relationship and iterator oddness
- Subject: Re: Re: Flattened relationship and iterator oddness
- From: Peter <email@hidden>
- Date: Tue, 19 Sep 2006 20:20:58 -0400
I have a similar problem trying to use a flattened relationship in my
WOUnitTesting.
I have this:
Study <->> StudyPeriod <->> StudySchedule
My flattened relationship periodSchedules is defined in my EOModel for
Entity Study as studyPeriods.studySchedules named "studySchedules".
I create the study, its periods and the periods' schedules using
WOUTMockEditingContext and the createSavedObject and
addRelationshipToBothSides... methods. All works fine when I
enumerated over the realtionships. It passes all of my tests for
custom methods I have. However, whenever accessing my flattened
relationship ("studySchedules"), rather than enumerating over the
to-many relationships, the result is always an empty array.
I am not sure if this is related to the faulting of flattenen
relationships or something specific with using the
WOUTMockEditingContext (not the newest version WOUT2)
Any ideas? Should I just stick to enumeration? It would just be nice
to be able to use the "shortcut" when I need it.
Thanks,
Pete
On 9/10/06, shaun <email@hidden> wrote:
Hey Fabian,
Fabian Peters wrote:
> Hi John, hi Jean-Pierre,
>
> thanks for your replies!
[snip]
> I'm still wondering about this one:
>
>>>> Order <->> OrderItem <<->> ProductionRun <-> DeliveryDefect
>>>>
>>>> In Order, I've defined a flattened relationship deliveryDefects. It
>>>> works fine for deliveryDefects that exist when the order is fetched
>>>> from the DB. However, it fails to include a deliveryDefect that is
>>>> created and then saved to the DB. Is this a known limitation of
>>>> flattened relationships?
>
>
> Is this behaviour to be expected? Is this documented anywhere? I
> couldn't find an awful lot of documentation on flattened relationships
> anyway.
>
Yes its expected, at least, I would expect it. When I did the WOII
course in 2001 I think it was mentioned as a reason to not use flattened
relationships, amoung other more obvious reasons. I have not seen any
documentation about it though that I can remember. Perhaps searching the
omnigroup list archive would give you more info.
cheers,
- shaun
_______________________________________________
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
_______________________________________________
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