cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malcolm Edgar" <malcolm.ed...@gmail.com>
Subject Cayenne 3.0M3 and NamedQueries
Date Tue, 25 Mar 2008 02:34:35 GMT
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

Mime
View raw message