Re: Prefetch in SelectQuery with a Qualifier

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Nov 13 2003 - 11:05:35 EST

  • Next message: Jorge Sopena: "Re: Prefetch in SelectQuery with a Qualifier"

    Hi Jorge,

    There is one known issue with prefetching that I suspect might cause
    the problem in your case:

            http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-12

    Could you send the details on what qualifier you are using?

    Andrus

    On Nov 13, 2003, at 6:45 AM, Jorge Sopena wrote:

    > 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.rev
    > erseDbPath(QueryUtils.java:520)
    >     at
    > org.objectstyle.cayenne.access.util.QueryUtils$ExpressionTranslator.<in
    > it>(QueryUtils.java:430)
    >     at
    > org.objectstyle.cayenne.access.util.QueryUtils.transformQualifier(Query
    > Utils.java:353)
    >     at
    > org.objectstyle.cayenne.access.util.QueryUtils.selectPrefetchPath(Query
    > Utils.java:321)
    >     at
    > org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.j
    > ava:794)
    >     at
    > org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.jav
    > a:866)
    >     at
    > org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.jav
    > a: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 - 11:05:41 EST