Prefetch in SelectQuery with a Qualifier

From: Jorge Sopena (jsopen..idsa.es)
Date: Thu Nov 13 2003 - 06:45:41 EST

  • Next message: Andrus Adamchik: "Re: Prefetch in SelectQuery with a Qualifier"

    As in the examples of prefetching, I'm trying to prefetch some
    relationships in my SelectQuery.
    If I do a simple prefetch over a SelectQuery without any Qualifier, it
    goes right.
       SelectQuery query = new SelectQuery(Request.class);
       query.addPrefetch("customer");
       query.addPrefetch("customer.company");

    But if my SelectQuery has a Qualifier, an exception is thrown:
        SelectQuery query = new SelectQuery(Request.class,where);
       query.addPrefetch("customer");
       query.addPrefetch("customer.company");

    This is the message error:
    java.lang.NullPointerException
        at
    org.objectstyle.cayenne.access.util.QueryUtils$ExpressionTranslator.reverseDbPath(QueryUtils.java:520)
        at
    org.objectstyle.cayenne.access.util.QueryUtils$ExpressionTranslator.<init>(QueryUtils.java:430)
        at
    org.objectstyle.cayenne.access.util.QueryUtils.transformQualifier(QueryUtils.java:353)
        at
    org.objectstyle.cayenne.access.util.QueryUtils.selectPrefetchPath(QueryUtils.java:321)
        at
    org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.java:794)
        at
    org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:866)
        at
    org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:744)
        at MapServer.Persistence.Request.search(Request.java:159)

    Am I doing sth wrong?
    Is there any restriction I should know?

    Thanks,

    Jorge Sopena



    This archive was generated by hypermail 2.0.0 : Thu Nov 13 2003 - 06:28:10 EST