Hi,
I've run this by Mike and neither of us understands why this doesn't
work. Is there something non-obvious happening or is this a bug in the
expression parser?
I get this exception:
org.objectstyle.cayenne.exp.ExpressionException: [v.1.2-dev September 9
2005] Divide: invalid parent - Equal
at
org.objectstyle.cayenne.exp.parser.ConditionNode.jjtSetParent(ConditionNode.java:24)
at
org.objectstyle.cayenne.exp.parser.SimpleNode.setOperand(SimpleNode.java:191)
at
org.objectstyle.cayenne.exp.Expression.transform(Expression.java:601)
at
org.objectstyle.cayenne.exp.Expression.transform(Expression.java:593)
at
org.objectstyle.cayenne.exp.parser.AggregateConditionNode.transform(AggregateConditionNode.java:80)
at
org.objectstyle.cayenne.exp.Expression.expWithParameters(Expression.java:381)
at
org.objectstyle.cayenne.query.SelectQuery.queryWithParameters(SelectQuery.java:397)
when I try using the following expression as a query qualifier.
1) Build the expression manually...
Expression a =
Expression.fromString("cachedImage.imageSpecification.width /
cachedImage.imageSpecification.height");
Expression b = Expression.fromString("$width / $height");
Expression c = ExpressionFactory.binaryExp(Expression.EQUAL_TO, a, b);
2) Or, enter this qualifier in the modeler query creator...
(cachedImage.imageSpecification.width /
cachedImage.imageSpecification.height) = ($width / $height)
in either case when you try using this expression in a query, the
exception is thrown.
This is also discussed here:
http://www.desktopbeautifier.com/cayenne/posts/list/22.page
Any ideas?
Thanks,
Gili
-- http://www.desktopbeautifier.com/
This archive was generated by hypermail 2.0.0 : Mon Sep 12 2005 - 12:08:56 EDT