I would like to implement the functionality for large queries where I only get 
back a "page" or sublist of the results using EJB3. This is mostly easy using 
the setMaxResults and setFirstResult stuff on Query. However, I don't see 
anyway to know things like how many total objects there are. I would like to 
provide info to my users like "showing 1 through 10 of 100" results. I don't 
want to run the query twice (once with max results and first result and once 
without to get the total) because that defeats the purpose. I assume this would 
not only hit the database twice but would end up instatiating all the objects 
in the whole result set. Has anyone figured a way around this?

Thanks in advance,

-jeff

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919413#3919413

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3919413


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to