Lachlan Deck commented on CAY-1072:
-----------------------------------
There's a problem also when dates are involved for comparison...
org.apache.cayenne.ejbql.EJBQLException: [v.3.0-SNAPSHOT May 14 2008 22:35:23] Error parsing EJB QL statement
[java] at org.apache.cayenne.ejbql.parser.EJBQL$EJBQLDefaultParser.compile(EJBQL.java:31)
[java] at org.apache.cayenne.query.EJBQLQuery.getExpression(EJBQLQuery.java:84)
[java] at org.apache.cayenne.query.EJBQLQueryMetadata.resolve(EJBQLQueryMetadata.java:45)
[java] at org.apache.cayenne.query.EJBQLQuery.getMetaData(EJBQLQuery.java:52)
[java] at org.apache.cayenne.util.ObjectContextQueryAction.<init>(ObjectContextQueryAction.java:79)
[java] at org.apache.cayenne.CayenneContextQueryAction.<init>(CayenneContextQueryAction.java:41)
[java] at org.apache.cayenne.CayenneContext.onQuery(CayenneContext.java:340)
[java] at org.apache.cayenne.CayenneContext.performQuery(CayenneContext.java:328)
[java] at ish.oncourse.cayenne.CayenneContext.performQuery(CayenneContext.java:292)
[java] at org.apache.cayenne.DataObjectUtils.objectForQuery(DataObjectUtils.java:274)
[java] at ish.oncourse.controller.ListController.allRecordsCount(ListController.java:420)
[java] at ish.view.components.OutputList$8.run(OutputList.java:567)
[java] at foxtrot.AbstractWorkerThread$1.run(AbstractWorkerThread.java:39)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at foxtrot.AbstractWorkerThread.runTask(AbstractWorkerThread.java:35)
[java] at foxtrot.workers.SingleWorkerThread.run(SingleWorkerThread.java:196)
[java] at foxtrot.workers.SingleWorkerThread.run(SingleWorkerThread.java:179)
[java] at java.lang.Thread.run(Thread.java:613)
[java] Caused by: org.apache.cayenne.ejbql.parser.ParseException: Encountered "a . student . enrolments . courseClass . endDateTime >= Tue Jun" at line 1, column 117.
[java] Was expecting one of:
[java] "(" ...
[java] "NOT" ...
[java] "+" ...
[java] "-" ...
[java] <DECIMAL_LITERAL> ...
[java] <INTEGER_LITERAL> ...
[java] ":" ...
[java] "?" ...
[java] "db:" ...
[java] <IDENTIFIER> "." "NEW" ...
[java] <IDENTIFIER> "." "ALL" ...
[java] <IDENTIFIER> "." "ANY" ...
[java] <IDENTIFIER> "." "EXISTS" ...
<...etc ...>
[java]
[java] at org.apache.cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java:9409)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(EJBQL.java:9286)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1931)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1909)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1774)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1736)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1926)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1909)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1774)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1736)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1926)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1909)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1774)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1787)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1787)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1736)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.where_clause(EJBQL.java:1583)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.select_statement(EJBQL.java:67)
[java] at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(EJBQL.java:39)
[java] at org.apache.cayenne.ejbql.parser.EJBQL$EJBQLDefaultParser.compile(EJBQL.java:28)
[java] ... 17 more
> org.apache.cayenne.query.SQLResultSetMapping must implement java.io.Serializable
> --------------------------------------------------------------------------------
>
> Key: CAY-1072
> URL: https://issues.apache.org/cayenne/browse/CAY-1072
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne JPA
> Affects Versions: 3.0
> Environment: ROP
> Reporter: Lachlan Deck
> Assignee: Andrus Adamchik
>
> so I've got this...
> public int allRecordsCount(Expression e) {
> ObjEntity entity = getContext().getEntityResolver().lookupObjEntity(getObjectClass());
> Expression qualifier = null;
> <...>
> String ejbqlWhereString = qualifier == null ? "" : " WHERE " + qualifier.toEJBQL("a");
> String ejbqlQueryString = "SELECT count(a) FROM " + entity.getName() + " a" + ejbqlWhereString;
> EJBQLQuery ejbqlQuery = new EJBQLQuery(ejbqlQueryString);
> Number count = (Number) DataObjectUtils.objectForQuery(getContext(), ejbqlQuery);
> return count.intValue();
> }
> But I'm getting this exception. Any ideas?
> org.apache.cayenne.CayenneRuntimeException: [v.3.0-SNAPSHOT May 14 2008 22:35:23] Remote error. URL - http://delish.ish.com.au:8181/angel-server-cayenne; CAUSE - Serialized class org.apache.cayenne.query.SQLResultSetMapping must implement java.io.Serializable
> [java] at org.apache.cayenne.remote.hessian.HessianConnection.doSendMessage(HessianConnection.java:147)
> [java] at org.apache.cayenne.remote.BaseConnection.sendMessage(BaseConnection.java:73)
> [java] at org.apache.cayenne.remote.ClientChannel.send(ClientChannel.java:281)
> [java] at org.apache.cayenne.remote.ClientChannel.onQuery(ClientChannel.java:113)
> [java] at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:317)
> [java] at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
> [java] at org.apache.cayenne.CayenneContext.onQuery(CayenneContext.java:340)
> [java] at org.apache.cayenne.CayenneContext.performQuery(CayenneContext.java:328)
> [java] at ish.oncourse.cayenne.CayenneContext.performQuery(CayenneContext.java:292)
> [java] at org.apache.cayenne.DataObjectUtils.objectForQuery(DataObjectUtils.java:274)
> [java] at ish.oncourse.controller.ListController.allRecordsCount(ListController.java:482)
-- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
This archive was generated by hypermail 2.0.0 : Tue Jun 10 2008 - 04:59:26 EDT