• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Complex EOQualifier format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Complex EOQualifier format


  • Subject: Complex EOQualifier format
  • From: Steven Mark McCraw <email@hidden>
  • Date: Wed, 4 Jul 2007 15:00:20 -0400

Hi all,

Does anyone know why I can't build an arbitrarily complex qualifier with EOF?

The following code

CCGGregorianCalendar now = new CCGGregorianCalendar();
now.setMonth(now.getMonth() + 3);
args.addObject(now.timestamp());
args.addObject(new NSTimestamp());
String qualString = "(POW((69.1 * ( location.longitude - " + zipCode.longitude() 
+ " ) * cos( " + zipCode.latitude() + " / 57.3)), 2) + " 
+ "POW((69.1 * ( location.latitude - " + zipCode.latitude() 
+ ")), 2)) < " 
+ _selectedMileageOption.intValue() * _selectedMileageOption.intValue()
+ " and bidCloseDate <= %@ and bidCloseDate > %@";
EOQualifier qual = EOQualifier.qualifierWithQualifierFormat(qualString, args);

Produces 

[2007-07-04 14:52:56 EDT] <WorkerThread6> com.webobjects.foundation.NSForwardException for com.webobjects.eocontrol._private.ParseException: Encountered "(" at line 1, column 5.
Was expecting one of:
    <IDENTIFIER> ...
    <ARGUMENT_PATH> ...
    "=" ...
    ">=" ...
    "<=" ...
    "=<" ...
    "<>" ...
    "!=" ...
    "=>" ...
    ">" ...
    "<" ...

    

at com.webobjects.eocontrol._private._EOQualifierParser.generateParseException(_EOQualifierParser.java:1044)
at com.webobjects.eocontrol._private._EOQualifierParser.jj_consume_token(_EOQualifierParser.java:980)
at com.webobjects.eocontrol._private._EOQualifierParser.parseOperatorList(_EOQualifierParser.java:562)
at com.webobjects.eocontrol._private._EOQualifierParser.RelOpExpression(_EOQualifierParser.java:638)
at com.webobjects.eocontrol._private._EOQualifierParser._expression_(_EOQualifierParser.java:594)
at com.webobjects.eocontrol._private._EOQualifierParser.parseLogicalExpression(_EOQualifierParser.java:872)
at com.webobjects.eocontrol._private._EOQualifierParser.ParenExpression(_EOQualifierParser.java:616)
at com.webobjects.eocontrol._private._EOQualifierParser._expression_(_EOQualifierParser.java:598)
at com.webobjects.eocontrol._private._EOQualifierParser.parseLogicalExpression(_EOQualifierParser.java:872)
at com.webobjects.eocontrol.EOQualifier.qualifierWithQualifierFormat(EOQualifier.java:941)
...

Do I just give up here and fetch raw rows with a pre-build SQL string, and then use the PK to fetch in the EO when I need it?  It's seems super lame to me that EOQualifier can't parse something with parentheses, but maybe I'm missing something obvious.

Mark

 _______________________________________________
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

  • Follow-Ups:
    • Re: Complex EOQualifier format
      • From: Steven Mark McCraw <email@hidden>
  • Prev by Date: Re: WOBuilder Replacement
  • Next by Date: Re: Complex EOQualifier format
  • Previous by thread: Re: WOLips: "<webobject> close tag is not found."
  • Next by thread: Re: Complex EOQualifier format
  • Index(es):
    • Date
    • Thread