• 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: Return single row?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Return single row?


  • Subject: Re: Return single row?
  • From: Bob Stuart <email@hidden>
  • Date: Wed, 3 Dec 2003 21:49:05 -0500

Drew,
Take a look at
EOUtilities. objectWithFetchSpecificationAndBindings

Given an EO named Book with a fetch spec in the model named SingleBookQuery that takes no parameters and returns only 1 row
           Book aBook = (Book)EOUtilities.objectWithFetchSpecificationAndBindings( ec, "Book", "SingleBookQuery", null);

If there was another fetch spec in the model that took a string parameter such as ISBN that for any given ISBN should only return 1 book
                      NSDictionary bindings = new NSDictionary("12345", "ISBN");
           Book aBook = (Book)EOUtilities.objectWithFetchSpecificationAndBindings( ec, "Book", "SingleBookQuery", bindings);

If the fetch spec of either of these returns more than 1 row an exception will be raised.

At 8:56 PM -0500 12/3/03, Drew Thoeni wrote:
>A newbie question:
>
>I have been through several of the tutorials/books recommended by the list (thanks for the tips) and have not found an example of using a fetchSpec to return a single row *and* then put that returned row into an object that can be tied to WOString fields (or other fields) for display.
>
>I am able to return lists and place them into a WORepetition and the data displays nicely. It's a single row I'm having difficulty with.
>
>Can someone point to an example of this?
>
>Regards,
>
>Drew
>_______________________________________________
>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.


--
Bob Stuart
_______________________________________________
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.

References: 
 >Return single row? (From: Drew Thoeni <email@hidden>)

  • Prev by Date: Return single row?
  • Next by Date: Re: Return single row?
  • Previous by thread: Return single row?
  • Next by thread: Re: Return single row?
  • Index(es):
    • Date
    • Thread