You can't use @count in a sql query.
On Jun 19, 2012, at 4:33 AM, Ron X <[email protected]> wrote:
> hi4all
>
> EOEditingContext editingContext = ERXEC.newEditingContext();
>
> NSMutableArray<EOQualifier> qualifiers;
> {
> qualifiers = new NSMutableArray<EOQualifier>();
> qualifiers.add(Artist.NAME_WITHOUT_THE_PREFIX.count().gt(1));
>
> }
> EOQualifier qual = ERXQ.or(qualifiers);
>
> Artist.clazz.objectsMatchingQualifier(editingContext, qual);
>
> but this fails with
>
> INFO 43.44 MB used/37.62 MB free [Thread-7]
> (ERXDatabaseContextDelegate.java:177) - Database Exception occured:
> java.lang.IllegalStateException: sqlStringForKeyValueQualifier: attempt to
> generate SQL for er.extensions.qualifiers.ERXKeyValueQualifier (@count > 1)
> failed because attribute identified by key '@count' was not reachable from
> from entity 'Artist'
>
> sorry, but I don't understand what does it mean
>
> why @count is not reachable?
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/mschrag%40pobox.com
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]