ObjectIdQuery Question

From: Andrew Lindesay (ap..indesay.co.nz)
Date: Sun Feb 07 2010 - 05:21:33 EST

  • Next message: Andrey Razumovsky: "Re: ObjectIdQuery Question"

    Hello;

    I am using 3.1 snapshot and am trying to do this in order to get an DataObject instance for the ObjectId which I have;

            DataContext dc = new DataContext();
            ObjectId xyzObjectId = xyzObjectIds.get(i);
            XYZ xyz = (XYZ) dc.performQuery(new ObjectIdQuery(xyzObjectId)).get(0);

    I get an NPE here;

            org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:335) at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96) at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1049) at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1038)

    Which is this in code;

            protected void runQuery()
            { this.response = actingContext.getChannel().onQuery(actingContext, query); }

    The problem is that there is no channel on the context.

    Am I using the API correctly?

    Regards;

    ___
    Andrew Lindesay
    www.lindesay.co.nz



    This archive was generated by hypermail 2.0.0 : Sun Feb 07 2010 - 05:22:15 EST