Re: NamedQuery parameters

From: Michael Gentry (blacknex..mail.com)
Date: Mon Jul 24 2006 - 11:08:24 EDT

  • Next message: Andrus Adamchik: "Re: NamedQuery parameters"

    "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 <emmpeege..mail.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
    >



    This archive was generated by hypermail 2.0.0 : Mon Jul 24 2006 - 11:08:49 EDT