SQLTemplate and using setPageSize(): IllegalArgumentException when executing query
----------------------------------------------------------------------------------
Key: CAY-1093
URL: https://issues.apache.org/cayenne/browse/CAY-1093
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 2.0 [STABLE]
Environment: Cayenne 2.0.4, JDK 1.5.0_16 on Windows XP SP3, Database: Oracle 10g, Release 10.2.0.3.0
Reporter: Jens Mayer
Assignee: Andrus Adamchik
Using a paginated SQLTemplate like this:
SQLTemplate rawQuery = (SQLTemplate)dataCtx.getEntityResolver().lookupQuery("myQuery");
Map<String,Object> params = new HashMap<String,Object>();
params.put("myParameter", myID);
rawQuery.setParameters(params);
rawQuery.setPageSize(50);
List<?> protList = dataCtx.performQuery(rawQuery);
throws the following error:
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
additional infos:
- the query is mapped via the modeler
- "fetch Data Objects" in modeler is unchecked
- the query is'nt shared across multiple DataContexts
- cloning the query has no effect
- the exception isn't thrown when call of setPageSize() is omitted
-- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
This archive was generated by hypermail 2.0.0 : Fri Aug 08 2008 - 02:56:08 EDT