|
Replies:
1
-
Last Post:
Jan 8, 2007 4:33 AM
by: cprashantreddy
|
|
|
|
|
|
|
glassfish JPA (Toplink Essentials) with large ResultSets
Posted:
Oct 11, 2006 1:40 AM
|
|
|
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
|
|
|
|
|
|
|
Re: glassfish JPA (Toplink Essentials) with large ResultSets
Posted:
Jan 8, 2007 4:33 AM
in response to: bmesserer
|
|
|
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
|
|
|
|
|