• 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
Unexpecting sort ordering on a parent (abstract) entity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unexpecting sort ordering on a parent (abstract) entity


  • Subject: Unexpecting sort ordering on a parent (abstract) entity
  • From: Dev WO <email@hidden>
  • Date: Sun, 24 Sep 2006 17:11:11 +0200

Hi,
I've got a hard time trying to get the fetch I want:), here's what I have:
a parent entity "Product" which is abstract and 2 sub-entities "ProductA" and "ProductB" (one table for A and one for B in the database).
A and B shares a common attribute "favorite" (define in Product) which is a NSTimestamp.
If I try to fetch "Product" to get only product with a "favorite" NSTimestamp and sort it, I got 2 joined fetches... which is I first got the "ProductA" sorted correctly then the "ProductB" also sorted correctly. I'm not sure I explain this correctly, I mean the fetch isn't "Product sorted by favorite NSTimestamp" but instead "ProductA sorted by favorite NSTimestamp +ProductB sorted by favorite NSTimestamp".

Here's what I'm using to fetch:
public NSArray topProductList() {
NSMutableArray sortOrderings = new NSMutableArray();
EOSortOrdering newSO = new EOSortOrdering("favorite", EOSortOrdering.CompareCaseInsensitiveDescending);
sortOrderings.addObject(newSO);
EOQualifier qualifier = EOQualifier.qualifierWithQualifierFormat("(favorite <> null)", null);
EOFetchSpecification fetchSpec = new EOFetchSpecification("Product", qualifier , sortOrderings);
return new NSArray(editingContext.objectsWithFetchSpecification(fetchSpec));
}


I need to be able to get only the x last favorite, but actually it will only return ProductA (as long as there's more than x ProductA with a favorite NSTimestamp), so even if I have a more recent favorite ProductB, I can't get it...

Does anyone know how I can get a fetch really sorted on the parent entity?

Thanks

Xavier

PS: If there's a way not involving Project Wonder it would be really nice. I'm going to "upgrade" this project with Wonder after it is delivered, but actually I'm already late on the delivery and I can't afford the time to test everything to see if it works on Wonder, especially I have a custom WOHyperlink so I'm not sure it won't break using Wonder...But I may be wrong;)
 _______________________________________________
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: Unexpecting sort ordering on a parent (abstract) entity
      • From: Dev WO <email@hidden>
  • Prev by Date: Re: constructing a url...
  • Next by Date: Help - Relationships, Bindings, w/Full Text Search
  • Previous by thread: Re: Who's got the <button>?
  • Next by thread: Re: Unexpecting sort ordering on a parent (abstract) entity
  • Index(es):
    • Date
    • Thread