-
1. Re: EntityQuery by Extension wrong maxResults
pampam Jun 1, 2007 9:36 AM (in response to dajevtic)There seams to be a bug in the query class.
truncResultList returns (maxResults-1) items at the momentreturn results.subList(0, mr-1)
should bereturn results.subList(0, mr)
Regards,
Robert -
2. Re: EntityQuery by Extension wrong maxResults
dajevtic Jun 1, 2007 9:44 AM (in response to dajevtic)Excellent, thanks pampam!
Is it safe to change the code by myself or will this have any negative impact on any other parts of EntityQuery? -
3. Re: EntityQuery by Extension wrong maxResults
dajevtic Jun 1, 2007 9:48 AM (in response to dajevtic)Wait! No good :-(
I am using CVS20070531 and the code alredy states:protected List truncResultList(List results) { Integer mr = getMaxResults(); if ( mr!=null && results.size() > mr ) { return results.subList(0, mr); } else { return results; } }
Any idea what else could be causing the problem? -
4. Re: EntityQuery by Extension wrong maxResults
dajevtic Jun 1, 2007 9:50 AM (in response to dajevtic)By the way I use .getDataModel() instead of .getResultList()
as the value binding for my dataTables. -
5. Re: EntityQuery by Extension wrong maxResults
pampam Jun 1, 2007 10:47 AM (in response to dajevtic)sorry, I had not seen that it has already been corrected in cvs.
-
6. Re: EntityQuery by Extension wrong maxResults
gavin.king Jun 1, 2007 1:35 PM (in response to dajevtic)Are you *sure* you have the latest (fixed) CVS version??
I just tested this, and it works great... -
7. Re: EntityQuery by Extension wrong maxResults
gavin.king Jun 1, 2007 1:39 PM (in response to dajevtic)Do you override createQuery()?
-
8. Re: EntityQuery by Extension wrong maxResults
dajevtic Jun 2, 2007 4:31 PM (in response to dajevtic)Hi Gavin. You were probable right. I used the cvs nightly build of 0531 which still had the problem. I am now using the current cvs (freshly checked out) and the results are shown correctly now.
I don't override createQuery however I do have a rather "uncommon" use of EntityQuery. I extend EntityQuery and the extended object is a stateful ejb3 session bean where I did override setEjbql() and some other "non-vital" functions (+ added a couple of my own "commonly" used functions).