SQLTemplate and setPageSize()

From: Jens Mayer (Jens.Mayer..mx.de)
Date: Wed Aug 06 2008 - 06:35:19 EDT

  • Next message: Lachlan Deck: "Re: MS SQL Server: Select Distinct on text datatype"

    Hi,

    i'm using Cayenne 2.0.4 with Oracle 10 and JDK 1.5.

    Please have a short look at this code:

    ... dataCtx, myID are set...

    SQLTemplate rawQuery = (SQLTemplate)dataCtx.getEntityResolver().lookupQuery("myQuery");
    Map<String,Object> params = new HashMap<String,Object>();
    params.put("processID", myID);
    rawQuery.setParameters(params);
    rawQuery.setPageSize(50);
    List<?> protList = dataCtx.performQuery(rawQuery);
    ...

    On runtime the follwoing Exception ist thrown:

    java.lang.IllegalArgumentException: org.apache.cayenne.query.SelectQuery: "setRoot(..)" takes a DataMap, String, ObjEntity, DbEntity, Procedure, or Class. It was passed a null
            at org.apache.cayenne.query.AbstractQuery.setRoot(AbstractQuery.java:104)
            at org.apache.cayenne.query.SelectQuery.init(SelectQuery.java:143)
            at org.apache.cayenne.query.SelectQuery.<init>(SelectQuery.java:83)
            at org.apache.cayenne.query.SelectQuery.<init>(SelectQuery.java:72)
            at org.apache.cayenne.access.IncrementalFaultList.<init>(IncrementalFaultList.java:129)
            at org.apache.cayenne.access.DataContextQueryAction.interceptPaginatedQuery(DataContextQueryAction.java:92)
            at org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:50)
            at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1395)
            at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1384)
            ..... more

    The mapped query is configured to fetch DataRows.

    The cause seems to be the method setPageSize(): if I omit this method, all works fine. I cannot find any restrictions for setPageSize and SQLTemplate in the documentation.

    Does anybody know what's going on here ?

    Thanks in advance

    Jens

    -- 
    Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
    Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
    



    This archive was generated by hypermail 2.0.0 : Wed Aug 06 2008 - 06:36:58 EDT