• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using distinct in to-many relationship?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using distinct in to-many relationship?


  • Subject: Re: Using distinct in to-many relationship?
  • From: Zak Burke <email@hidden>
  • Date: Mon, 21 Aug 2006 14:41:00 -0400

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using distinct in to-many relationship?
      • From: Marcos Trejo Munguia <email@hidden>
References: 
 >Using distinct in to-many relationship? (From: Marcos Trejo Munguia <email@hidden>)

  • Prev by Date: Using distinct in to-many relationship?
  • Next by Date: Re: specify the size of a target blank window in the wod file
  • Previous by thread: Using distinct in to-many relationship?
  • Next by thread: Re: Using distinct in to-many relationship?
  • Index(es):
    • Date
    • Thread