Re: Mysterious field not reachable from entity error
Re: Mysterious field not reachable from entity error
- Subject: Re: Mysterious field not reachable from entity error
- From: "Matt Kime" <email@hidden>
- Date: Fri, 8 Sep 2006 06:54:00 -0400
You're correct, the attribute is only in code and not in the model. Is
it possible to filter by such an attribute?
Here is a verbose description of what I'm doing - State objects have
Gallery objects. galleries() is the array of Gallery objects belonging
to State. galleriesActive() is a filter on this array.
hasOpeningPlusZeroDays() is a function returning a boolean value based
on the count of a filter on galleriesActive(). I'm trying to ask my
object if it has any galleries meeting a certain criteria. "Does this
state have any galleries opening today?"
My functions are working well for providing me with the necessary info
but it doesn't allow me to search on it. Do I need to use another
method to accomplish this?
many thanks,
matt
On 9/8/06, John Larson <email@hidden> wrote:
Matt -
You're absolutely right that you can filter on functions, and if you
can see the data you should be there. But, there are two things I
don't understand. First, I've only ever seen the sql error message
when you are trying to put together a fetch specification for an
attribute that isn't in the model, but is in code. But, it doesn't
look like you're fetching from the db here. That's just a disclaimer
that I'm not sure what's happening there. Second, is the method
hasOpeningPlusZeroDays in the State class? If it is, then when you
filter on the array of galleries "galleriesActive()" EOQualifier
isn't going to find the field hasOpeningPlusZeroDays because it isn't
in the gallery's keypath. (assuming that the galleries is full of
galleries and not states) Lastly, I'm a little confused what you're
doing there at the end altogether, because it looks like you have a
circular reference: galleriesWithOpeningPlusZeroDays uses
hasOpeningPlusZeroDays and hasOpeningPlusZeroDays is using
galleriesWithOpeningPlusZeroDays.
John
_______________________________________________
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