The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: glassfish JPA (Toplink Essentials) with large ResultSets

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Last Post: Jan 8, 2007 4:33 AM by: cprashantreddy
bmesserer

Posts: 5
glassfish JPA (Toplink Essentials) with large ResultSets
Posted: Oct 11, 2006 1:40 AM
  Click to reply to this thread Reply

Hi all,

I have the problem that I want to display a large ResultSet within a JTable - I already figured out I can "paginate" it via Query.setFirstResult() and Query.setMaxResults().
I just don't understand why I can't configure glassfish-persistence/TopLink Essentials in a way so I can simply use a normal query ("select c from Customer c") and TopLink will instantiate JPA-entity objects "on demand", say in pages of 100, why does it insist mapping the complete result into entities at once instead of only retrieving the objects I requested? Why do I need to implement pagination myself for such a simple case? - since this means putting an abstraction layer above JPA-Queries, first testing whether there are a lot of results via "select COUNT()..." and then using either a "normal" or paginated query.
I think that it is quite common to display large resultsets in tables showing only the first X rows, isn't it?

Help appreciated

cprashantreddy

Posts: 32
Re: glassfish JPA (Toplink Essentials) with large ResultSets
Posted: Jan 8, 2007 4:33 AM   in response to: bmesserer
  Click to reply to this thread Reply

I do not have answer to this. Toplink does not have a Query hint that you can specify to limit the page size.

I thought this kind of setting (limiting page size of result set) would be useful on properties marked @OneToMany @ManyToMany etc..

Following is my unanswered question to forum.
http://forums.java.net/jive/thread.jspa?messageID=188956




 XML java.net RSS