cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Frovarp <rfrov...@apache.org>
Subject Re: Modeling object queries
Date Thu, 29 Sep 2011 22:06:52 GMT
Thanks. Looking at the output it was doing what I wanted to do. I was 
able to see my error. If you are using the modeler, you can just say:

status = "Completed"

without escaping the quotes.

On 09/29/2011 01:34 PM, John Huss wrote:
> http://cayenne.apache.org/doc30/building-expressions.htmlThat looks right
> according to this page:
>
> Character constants should be enclosed in single or double quotes:
>
> // e1 and e2 are equivalentExpression e1 = Expression.fromString("name
> = 'ABC'");
> Expression e2 = Expression.fromString("name = \"ABC\"");
>
> One link the to formal grammer that I see in a couple places is broken:
> formal grammar<http://incubator.apache.org/cayenne/1_2/grammar/ExpressionParser.html>
>
> But this one works:
> http://cayenne.apache.org/doc30/bnf-for-expressionparser.html
>
> It says:
>
> simpleCondition 	::= 	scalarExpression ( simpleNotCondition |
>                                       ( "=" | "==" ) scalarExpression |
>                                       ( "!=" | "<>" ) scalarExpression |
>
> I would check the SQL that is outputted and run it against the database
> manually - it may be your expectation that is wrong.
>
> John
>
> On Thu, Sep 29, 2011 at 1:23 PM, Richard Frovarp<rfrovarp@apache.org>wrote:
>
>> I'm trying to figure out how to model a couple of named queries, preferably
>> in the object modeler:
>>
>> I've got this working
>>
>> Qualifier: status = $status
>>
>> I can't get this working
>>
>> Qualifier: status = "Completed"
>>
>> In fact, that query returns nothing, but
>>
>> status != "Completed"
>>
>> Returns everything, including objects where status = "Completed".
>>
>


Mime
View raw message