EJBQL and parameters

From: Francois Eyl (fey..maeur.com)
Date: Wed Apr 08 2009 - 05:48:06 EDT

  • Next message: Michael Gentry: "Re: "Can't get primary key from temporary id" :("

    Howdy guys,

    I'm trying to use EJBQL query and parameters, but I can't get it to work. Is
    there something special for ?
    Bellow is a quick sample of what I'm doing :

                    String queryString = "SELECT us.:SKDID FROM :USCHED us WHERE
    us.:UID=1";
                    EJBQLQuery query = new EJBQLQuery(queryString);

                    query.setParameter("SKDID", 1);
                    query.setParameter("USCHED",
    UserSchedule.class.getSimpleName());
                    query.setParameter("UID", UserSchedule.USER_ID_PROPERTY);

                    try {
                       ctx.getContext().performQuery(query);
                    } catch (CayenneRuntimeException e) {
                        System.err.println(e.getMessage());
                    }

    I'm getting the following message : "[v.3.0M5 Dec 09 2008 00:42:23] Error
    parsing EJB QL statement".

    Can somebody tell me where I'm wrong ?

    Thanks,
    Francois.



    This archive was generated by hypermail 2.0.0 : Wed Apr 08 2009 - 05:48:39 EDT