Re: Parameterized Queries

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Mar 20 2004 - 16:33:27 EST

  • Next message: Steve Wells: "Why is a refetchObject required"

    Hi Gary,

    On Mar 20, 2004, at 4:08 AM, Gary Jarrel wrote:
    > ExpressionFactory.binaryExp(Expression.IN, "propertyType",
    > new ExpressionParameter("propertyType")));

    There two issues with this: first you should use "binaryPathExp" so
    that "propertyType" is interpreted as a property. Second is a bug in
    Cayenne - when a parameter is substituted with a list, it is not done
    correctly.

    I opened a bug report to track it:
    http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-107 . And
    good news is that I already fixed it in CVS, and will try to make the
    code available ASAP (probably as 1.0.7, since we already have a number
    of unreleased bug fixes).

    On a side note, Cayenne 1.1 will make your life much easier. New
    expression API and Modeler query support was specifically designed with
    search queries like yours in mind. I still need to check if 1.1 also
    has this particular bug, and fix it if so.

    Andrus



    This archive was generated by hypermail 2.0.0 : Sat Mar 20 2004 - 16:33:32 EST