Re: Cayenne 3.0M3 and NamedQueries

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Mar 25 2008 - 06:08:16 EDT

  • Next message: Laszlo Sas: "EJBQL: Fetch joins are not yet supported."

    Hmm... since we were not aware of the original problem, I can't really
    tell whether this works in 3.0.

    Andrus

    On Mar 25, 2008, at 4:34 AM, Malcolm Edgar wrote:

    > Hi All,
    >
    > I have been upgrading an Cayenne 1.2 project to 3.0M3. I wanted to
    > know if some behaviour has changed.
    >
    > I have had an issues RawSQL queries, where objects added have not been
    > evaluated by Velocity in the SQL template.
    >
    > For example ${user.id} won't be evaluated to User.getId(). However
    > if I evaluate this in code, and then put ${userId} into the query a
    > parameter this works.
    >
    >
    > // Works
    > Map params = Collections.singletonMap("userId",
    > getUserDetails().getId());
    > NamedQuery query = new NamedQuery("ToDoSubmissionsForUser",
    > params);
    >
    > // Does not work
    > Map params = Collections.singletonMap("user", getUserDetails());
    > NamedQuery query = new NamedQuery("ToDoSubmissionsForUser",
    > params);
    >
    >
    > regards Malcolm Edgar
    >



    This archive was generated by hypermail 2.0.0 : Tue Mar 25 2008 - 06:08:53 EDT