-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Large table views in Hibernate
PostPosted: Wed Aug 16, 2006 7:26 pm 
Newbie

Joined: Wed Aug 16, 2006 7:15 pm
Posts: 2
Hi, I am extremely new to Hibernate and ORM having just started migrating my apps over from very old and clunky Delphi forms connected to MySQL. Many of my apps require that data is viewed in table form so that you can compare many records and update several at a time.

I have just grasped the concept of Hibernate and very excited about using it and have already put together a couple objects, hbms and single record forms but I am a little stuck as to how I can do large list forms that will show up to 60 records at any one time and also scroll quickly through the remaining thousands of records.

What is the typical approach when using Hibernate in this way? Would I need one object per row in such a large form or have as many as are visible and have some clever way of loading and unloading objects as the user scrolls?

Sorry for such a green question but I just wanted to get a general idea of the solution before getting too engrossed.

Thanks,

Chad.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 16, 2006 8:17 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
The Query object has the setFirstResult, setMaxResults and setFetchSize methods. These are used for paging objects: load objects 1-60, then 61-120, etc.

Bulk updates to loaded objects aren't very feasible, as you do have to load each object, modify it, and save it. You can issue direct SQL, or make use of HQL's limited DML support ("update YourClass set property1 = :newVal where property1 = :oldVal"), if the bulk updates are simple enough.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 17, 2006 6:00 am 
Newbie

Joined: Wed Aug 16, 2006 7:15 pm
Posts: 2
Thanks Tenwit, that gives me plently to look into. The updates are fairly simple as the user just highlights a group of records and then uses preset button to change certain field values so DLM sounds like a good possibility.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.