cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Gentry" <blackn...@gmail.com>
Subject Re: NamedQuery parameters
Date Mon, 24 Jul 2006 15:08:24 GMT
"loginid" and "password" are Java (ObjEntity) attributes and "Login"
is the name of the query defined in Cayenne Modeler.  The query also
specifies the class (and therefore DataNode) to use to perform the
query.  Does that help?

/dev/mrg


On 7/24/06, Marcel <emmpeegee@gmail.com> wrote:
>
> 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