cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel <emmpee...@gmail.com>
Subject NamedQuery parameters
Date Mon, 24 Jul 2006 14:46:37 GMT

Hi all,

The following is from the wiki[1]:

---------------
String[] keys = new String[] {"loginid", "password"};
Object[] values = new String[] {"joe", "secret"};

NamedQuery query = new NamedQuery("Login", keys, values);

List matchingUsers = context.performQuery(query);
---------------

I had presumed that this executes the query Login finding users where 
loginid = "joe" and password = "secret.

Do the parameters need to be defined in the query beforehand? If so, 
how? If not, are they object attribute names or database attribute names?

Cheers,

Marcel

[1] http://cwiki.apache.org/CAYDOC/namedquery.html

Mime
View raw message