Re: Bindings From 2 Entities - How?
Re: Bindings From 2 Entities - How?
- Subject: Re: Bindings From 2 Entities - How?
- From: Chuck Hill <email@hidden>
- Date: Wed, 05 Mar 2003 10:10:48 -0800
Use a key *path* not a simple key, just like in bindings in WOBuilder.
Assuming the to-one relationship is named navPage:
EOSortOrdering navPageNameSortOrdering =
EOSortOrdering.sortOrderingWithKey("navPage.navPageName",
EOSortOrdering.CompareAscending);
Chuck
At 05:45 PM 05/03/2003 +0000, Jonathan Fleming wrote:
>Firstly, the EOModel Entity relationships are TbNavPage(toOne) >> <
>(toMany)TbNavPageContentPosition
>
>The statements code below make up a fetch specification from the attributes
>of the Entity TbNavPageContentPosition
>but there is an attribute in the toOne table/entity - TbNavPage - which I
>would like to include in the bindings.
>How do I fix this (if possible) so that I can uncomment the 2 bits of
>offending code and include the property navPageName from the TbNavPage
>entity/table?
>
>EOQualifier qualifier = EOQualifier.qualifierToMatchAllValues(queryBindings
>);
>
> //EOSortOrdering navPageNameSortOrdering =
>EOSortOrdering.sortOrderingWithKey("navPageName",
>EOSortOrdering.CompareAscending);
> EOSortOrdering statusSortOrdering =
>EOSortOrdering.sortOrderingWithKey("status",
>EOSortOrdering.CompareAscending);
> EOSortOrdering visibilitySortOrdering =
>EOSortOrdering.sortOrderingWithKey("visibility",
>EOSortOrdering.CompareAscending);
>
> NSArray sortOrderings =
> new NSArray( new Object[]{/*navPageNameSortOrdering,
>*/statusSortOrdering, visibilitySortOrdering});
>
> EOFetchSpecification fetchSpec = new
>EOFetchSpecification("TbNavPageContentPosition", qualifier, sortOrderings);
>
> EOEditingContext myEditingContext =
>this.session().defaultEditingContext();
>
> navPageContentPositionList =
>myEditingContext.objectsWithFetchSpecification(fetchSpec);
>
>Kind regards
>Jonathan
>
>_________________________________________________________________
>It's fast, it's easy and it's free. Get MSN Messenger today!
>http://messenger.msn.co.uk
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.