-->
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: Ideas for Paging Search Result of 2 Criterias?
PostPosted: Tue Oct 03, 2006 7:12 am 
Newbie

Joined: Thu Jul 06, 2006 8:38 am
Posts: 14
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.3

Name and version of the database you are using: Oracle 9i


Hi, I've been implementing a lot of searching with the Criteria API recently. What a great API! Love it! There's one more thing I haven't figured out how to do though: paging the combined result of 2 (or more) criteria(s?).

In our search page, we search different entities based on user's selection. The problem comes because there's an option "All" ;-) Basically then I need to do searching on entity A and B, and combine the results into one big search result page. Any idea whether it's possible to combine this using Hibernate, or I must do the paging manually?

Cheers!
Ray


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 5:00 am 
Newbie

Joined: Thu Jul 06, 2006 8:38 am
Posts: 14
Ah, silly me. This is not a Hibernate problem but a database problem. I created a view that is a union of the two entities, and use Criteria API against that view.

It works perfectly.


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.