cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Lamy <davel...@gmail.com>
Subject Re: ParseException with EJBQL expression
Date Fri, 04 Dec 2009 14:09:32 GMT
I can get rid of the likeIgnoreCase and see what happens.  So I'm OK on the
alias part right?  In my other tests it didn't need an "as".  I've mainly
been concerned about whether that "doublehop" (.productStyles.taxonomy)
would be valid or not.

FYI that popped straight out of an Expression.toEJBSQL().  Not sure how best
to handle situations like that, where the Expression supports a notion that
EJBSQL does not.

On Fri, Dec 4, 2009 at 7:31 AM, Andrus Adamchik <andrus@objectstyle.org>wrote:

> "likeIgnoreCase" is not valid in EJBQL. Although the error message refers
> to something else... strange...
>
>
>
> On Dec 4, 2009, at 4:12 AM, Dave Lamy wrote:
>
>  Hey guys--
>>
>> I'm really just now getting into using the EJBQLQuery and am having some
>> difficulties.  I don't know whether I'm doing something fundamentally
>> wrong
>> or what.
>>
>> Here's my EJBQL expression that I'm trying to get parsed (running 3.0B1):
>>
>> select COUNT(foo) from ProductCollection foo where
>> foo.productStyles.taxonomy likeIgnoreCase '323.%'
>>
>> Parsing this query yields the following exception:
>>
>>
>> org.apache.cayenne.ejbql.parser.ParseException: Encountered " <IDENTIFIER>
>> "foo "" at line 1, column 53.
>> Was expecting:
>>   "(" ...
>>
>>   at
>>
>> org.apache.cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java:9419)
>>   at
>> org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(EJBQL.java:9298)
>>   at
>> org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1933)
>>   at
>> org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
>>   at
>> org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
>>   at
>>
>> org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
>>   at
>> org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1928)
>>   at
>> org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
>>   at
>> org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
>>   at
>>
>> org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
>>   at org.apache.cayenne.ejbql.parser.EJBQL.where_clause(EJBQL.java:1585)
>>   at org.apache.cayenne.ejbql.parser.EJBQL.select_statement(EJBQL.java:69)
>>   at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(EJBQL.java:41)
>> ...
>>
>> The statement looks legit to me.  Is there like a fundamental something
>> I'm
>> not understanding about EJBQL?  I saw some docs that showed doing this
>> sort
>> of join alias "IN" thing,
>>
>> SELECT OBJECT(e) FROM Department d, IN(d.employees) e
>>   WHERE d.name = ?1 AND e.salary > ?2
>>
>> My problem is that I'm using Expression.toEJBQL() to gen the where
>> clause..
>> was hoping to not have to recreate my code that generates the Expression
>> object.
>>
>> Help!
>>
>> Dave
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message