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 PROTECTED]> 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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/burnes.peter%40gmail.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to