Re: Fetch Spec bindings with raw SQL hints
Re: Fetch Spec bindings with raw SQL hints
- Subject: Re: Fetch Spec bindings with raw SQL hints
- From: John Boynton <email@hidden>
- Date: Tue, 12 Aug 2003 14:56:54 -0600
Thanks for your reply, Art.
Art Isbell wrote:
> 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.
I was seeing unexpected results also when writing one manually, in
reaching through several levels of to-many relationships. For now I am
just walking through the to-many relationships manually instead of using
a fetch specification.
> 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.
The trick here, if writing the query manually, is to write it with the
column names in the correct order, since the EODatabasContext
documentation states:
The expression must query the same attributes in the same order
that Enterprise Objects Framework would if it were generating
the SELECT expression dynamically.
If you use the "Use Raw SQL Expression" selection in the SQL panel of
EOModeler's Fetch Specification, the order is generated for you, so I
was wanting to just modify the WHERE clause in EOModeler. It *looks*
like it generates column names in alphabetical order of their
corresponding attributes, but I don't see any guarantee of that
anywhere. Is there such a guarantee?
Thanks,
John
_______________________________________________
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.