Re: Dynamic SQL object query

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Nov 23 2010 - 08:01:43 UTC

  • Next message: Andrus Adamchik: "Re: problems after upgrading jetty and hessian to the latest version"

    On Nov 21, 2010, at 6:18 PM, Marek Šabo wrote:

    > 1) When 'id' is not object-mapped ejbql complains about invalid path, I found only this
    > http://www.mail-archive.com/use..ayenne.apache.org/msg02992.html
    > and it seems to be a dead end. Foolish attempt prefixing with 'db:' didn't work.

    Unfortunately yes - it has to be mapped as an ObjAttribute. Another leftover from us trying to copy JPA :-/ We are thinking now how to reconcile it with Cayenne traditional APIs.

    > 2) I thought null parameters were supported from 3.0 on, I'm using 3.0.1 and in the following ejbql query:
    >
    > "SELECT COUNT(u) FROM User u WHERE u.username like :usernam AND u.userInfo.name like :userName"
    > eq.setParameter("userName", null);
    > eq.setParameter("usernam", "msabo");
    >
    > results in java.lang.ClassCastException: org.apache.cayenne.ejbql.parser.EJBQLPatternValue cannot be cast to org.apache.cayenne.ejbql.parser.EJBQLEquals

    Looks like a bug. Please log a Jira.

    Thanks,
    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Nov 23 2010 - 08:02:14 UTC