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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to