-->
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.  [ 2 posts ] 
Author Message
 Post subject: Technique Advice: Paging/Sorting/Processing User Actions
PostPosted: Thu Dec 16, 2004 6:44 pm 
Newbie

Joined: Wed Aug 25, 2004 10:43 pm
Posts: 14
Location: NJ
I'm a novice Hibernate user, and am trying to create some "list" pages that include sorting, paging and checkboxes for deleting. Basically the same exact thing you would see in a webmail client like Hotmail, or Yahoo Mail.

I want to do this in an efficent, easy to code way. I already have Paging working using the Page class at the bottom of this page: http://blog.hibernate.org/cgi-bin/pollx ... ation.html

I'm not sure what strategy I should take for so many aspects of this. For example, should I retrieve the entire result set for my list and keep it in the user's session and do sorting/processing based on that session list? Or should I hit the database each time the user pages, sorts, or does an action? I understand the tradeoffs of each, but what is the more common technique with hibernate?

If I go the route of hitting the database each time, I'm confused as to how to do the sorting. I'm using createQuery right now, and I can't figure out how to change the order by column and order. Is it only possible to change these values when using createCriteria?

And how would I process user actions? My idea would be to have checkboxes for each row of data in the page with the PK as the value, and when the form is submitted, pass all of these values into an IN expression in the where clause of an UPDATE or DELETE. I don't see how I can do this with a Query object either. Alternatively, I guess I would have to loop through each PK, and call a hibernate delete on each one.

I'll stop here and just ask if I'm thinking about Hibernate's coding strategy in the right way. I want to get into the right mindset, but I'm having trouble getting there.

Are there any example applications out there that implement this "list" type of feature I'm trying to do?

Thanks :)


Top
 Profile  
 
 Post subject: goodpoint
PostPosted: Mon Jan 17, 2005 1:13 pm 
Newbie

Joined: Mon Jan 17, 2005 1:09 pm
Posts: 19
I also consider this a very good question. I would be nice if someone could aswer it. Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.