• 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: Fetch Only Non-Empty To-Many
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetch Only Non-Empty To-Many


  • Subject: Re: Fetch Only Non-Empty To-Many
  • From: Hunter Hillegas <email@hidden>
  • Date: Wed, 9 Jun 2004 13:44:50 -0700

I've experimented with this some more and still can't get it to work.

Is what I am trying to do impossible?


On Jun 8, 2004, at 7:09 PM, Hunter Hillegas wrote:

Thanks for the feedback. I gave this a try and didn't get the SQL I expected... There WHERE clause doesn't even reference the relationship:

SELECT t0.previous_on_property, t0.rec_num, t0.slot_club_phone, t0.street_address, t0.toll_free_phone, t0.us_state, t0.website_url, t0.zip_code FROM hotel t0 WHERE t0.rec_num is not NULL ORDER BY UPPER(t0.hotel_sort_name) ASC

Did I make a mistake somewhere?

My/your code:

NSMutableArray sortOrderings = new NSMutableArray();
EOSortOrdering hotelSortNameSortOrdering = EOSortOrdering.sortOrderingWithKey("hotelSortName", EOSortOrdering.CompareCaseInsensitiveAscending);
sortOrderings.addObject(hotelSortNameSortOrdering);


NSArray bindings = new NSArray(new Object []{NSKeyValueCoding.NullValue});
EOQualifier q = EOQualifier.qualifierWithQualifierFormat("photoGallery != %@", bindings);
EOFetchSpecification fs = new EOFetchSpecification("Hotel", q, sortOrderings);
theHotelWithPicturesList = new NSMutableArray(editingContext.objectsWithFetchSpecification(fs));


On Jun 8, 2004, at 4:46 PM, David Elsner wrote:

Yes don't use EOModeler, just do it in code

NSArray bindings = new NSArray( new Object []{NSKeyValueCoding.NullValue});
EOQualifier q = EOQualifier.qualifierWithQualifierFormat("photoGallery != %@", bindings);
EOFetchSpecification fs = new EOFetchSpecification("Hotel", q, null);
NSArray hotelList = ec.objectsWithFetchSpecification(fs));



On 09/06/2004, at 8:39 AM, Hunter Hillegas wrote:

I have an entity, Hotel, with a to-Many relationship to another entity, PhotoGallery.

I am trying to construct a fetch in EOModeler that returns all of the hotels that have at least one photo gallery (i.e., no hotels without photo galleries).

Is there an easy way to do this?
_______________________________________________
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.
_______________________________________________
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.


  • Follow-Ups:
    • Re: Fetch Only Non-Empty To-Many
      • From: Art Isbell <email@hidden>
References: 
 >Fetch Only Non-Empty To-Many (From: Hunter Hillegas <email@hidden>)
 >Re: Fetch Only Non-Empty To-Many (From: David Elsner <email@hidden>)
 >Re: Fetch Only Non-Empty To-Many (From: Hunter Hillegas <email@hidden>)

  • Prev by Date: Re: Damn Thing
  • Next by Date: Re: Fetch Only Non-Empty To-Many
  • Previous by thread: Re: Fetch Only Non-Empty To-Many
  • Next by thread: Re: Fetch Only Non-Empty To-Many
  • Index(es):
    • Date
    • Thread