• 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 Spec bindings with raw SQL hints
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetch Spec bindings with raw SQL hints


  • Subject: Re: Fetch Spec bindings with raw SQL hints
  • From: Art Isbell <email@hidden>
  • Date: Tue, 12 Aug 2003 10:00:49 -1000

On Tuesday, August 12, 2003, at 05:00  AM, John Boynton wrote:

I am trying to construct a fetch specificiation in EOModeler that
involves paths to to-many relationships. Apple Radar #2841084
("Fetch Specs which reference other entities generate incorrect SQL")
instructs us to use a raw SQL expression to work around the problem.

This bug seems to be specific for fetch specs defined in EOModeler. Therefore, another workaround might be to define the fetch spec programmatically. That might be better than including database-specific SQL in a fetch spec hint.


However, I am at a loss as to how to include the bindings in the raw SQL that are required by this particular Fetch Specification. How can I do this?

You will use the bindings to compose an SQL string to set as a fetch specification hint. A hint is a key-value pair in an NSDictionary. The key in this case is "CustomQueryExpressionHintKey" with the value being the SQL string. EOFetchSpecification's setHints() method takes this hints dictionary as an argument.


The bindings will be set by the time your action method is invoked. This action method will perform the fetch. So the method will need to check the values of each binding and add each value to the "where" clause of the SQL string. You need to determine whether a null binding value will result in the generation of a "where" clause for that column or not.

Aloha,
Art
_______________________________________________
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 Spec bindings with raw SQL hints
      • From: John Boynton <email@hidden>
References: 
 >Fetch Spec bindings with raw SQL hints (From: John Boynton <email@hidden>)

  • Prev by Date: Re: Debugging a WO app
  • Next by Date: Re: Deployment with Eclipse [NEWBIE]
  • Previous by thread: Fetch Spec bindings with raw SQL hints
  • Next by thread: Re: Fetch Spec bindings with raw SQL hints
  • Index(es):
    • Date
    • Thread