Marcos Trejo Munguia wrote on 8/21/06 2:17 PM:
> Recently I found that the SQL generated by a fetch using
> setPrefetchingRelationshipKeyPaths with a to-many relationship generates
> the query without distinct while for to-one relationships uses distinct.

Call setUsesDistinct(true) on your fetch-spec.

I just discovered this too. It was the source of some very mysterious
seeming behaviour -- extra copies of EOs would show up in lists with
(seemingly) no explanation.

>From the javadoc:

        public void setUsesDistinct(boolean usesDistinct)
        Sets whether duplicate objects or records are removed after
        fetching. If flag is true they are removed (that is, proper sets
        are returned). If flag is false they aren't (multisets are
        returned). EOFetchSpecifications by default don't use distinct.

zak.
 _______________________________________________
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