objectFromDataRow NPE

From: Rorison, Jeff (Jeff_Roriso..ra.com)
Date: Wed Oct 06 2010 - 18:04:28 UTC

  • Next message: Tomas Stenlund: "Re: Exception in Cayenne Modeler, heap blows up"

    I am using 3.0 (final) and am having some issues using
    context.createFromDataRow(...)

    ObjectResolver is throwing an NPE on what looks like updating snapshots.

     

    Code:

         SQLTemplate template = .....

         template.setFetchingDataRows(true);

         ...

         List res = this.dataContext.performQuery(template);

         Subject sub = (Subject)context.objectFromDataRow(Subject.class,
    (DataRow)res.get(0), true);

     

    Err:

    java.lang.NullPointerException

                    at
    org.apache.cayenne.access.ObjectResolver.objectsFromDataRows(ObjectResol
    ver.java:117)

                    at
    org.apache.cayenne.access.ObjectResolver.synchronizedObjectsFromDataRows
    (ObjectResolver.java:94)

                    at
    org.apache.cayenne.access.DataContext.objectsFromDataRows(DataContext.ja
    va:597)

                    at
    org.apache.cayenne.access.DataContext.objectFromDataRow(DataContext.java
    :646)

                    ...........

     

    What, if anything am I doing incorrectly here? I have tried changing the
    refresh, and most of the other API calls with no success?

    Has this changed any in 3.0, as I see a few differences between the API
    and the docs?



    This archive was generated by hypermail 2.0.0 : Wed Oct 06 2010 - 18:08:28 UTC