objectsWithFetchSpecificationAndBindings, what attribute to use on an NSArray
objectsWithFetchSpecificationAndBindings, what attribute to use on an NSArray
- Subject: objectsWithFetchSpecificationAndBindings, what attribute to use on an NSArray
- From: Baiss Eric Magnusson <email@hidden>
- Date: Wed, 26 Sep 2007 11:56:59 -0700
How can I write a Fetch Specification where one of its conditions is
to check for an NSArray length of greater than zero.
I need to get a sorted array:
Area ofArea;
bindings.setObjectForKey( ofArea.getPrimaryKey(), "areaID" );
eventsWithRegistrants =
EOUtilities.objectsWithFetchSpecificationAndBindings( ec,
"getEventsWithRegistrants", "dancers", bindings );
In the DanceEvent table in EOModeler I have the Fetch Specification
<getEventsWithRegistrants>:
((areaID = $areaID) and (dancers.count > 0))
In EOGenericRecord sub-class:
public NSArray dancers() {
return (NSArray)storedValueForKey("dancers");
}
But I get IllegalStateException] sqlStringForKeyValueQualifier:
attempt to generate SQL for
com.webobjects.eocontrol.EOKeyValueQualifier (dancers.count >
(java.math.BigDecimal)'0') failed because attribute identified by key
'dancers.count' was not reachable from from entity 'DanceEvent':
getEventsWithRegistrants failed
Do I have to use a derived attribute? ( I couldn't figure out how to
get EOModel to create one ).
----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>
_______________________________________________
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