-->
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: What to do if Criteria queries limitations are a problem?
PostPosted: Fri Oct 16, 2009 1:54 am 
Regular
Regular

Joined: Tue May 12, 2009 6:08 am
Posts: 92
What does one do when the Criteria api presents enough limitations that you have to go to HQL anyway?

I have to build a massive, dynamic query. It's basically a really complicated one where one string needs to be matched on several joins and columns (and there's lots of these type) and sometimes the user can say things like, "Only the results with category A, B and F", etc. There's multiples of those too... and they can all happen at once. All this needs to be built dynamically.

Some of these features are really a snap in the Criteria api, while other things are kind of a pain, like sub queries (they never really seem to work right for me) and getting distinct result sets back (the main problem).

It is possible that I don't know enough about the Criteria api too. Can it do really intense search queries and filtering like I described? Or does it come a point that HQL is the only way to go?

And if that's the case, is there anything out there to at least build/manage these beast of a queries a tad more easily?


Top
 Profile  
 
 Post subject: Re: What to do if Criteria queries limitations are a problem?
PostPosted: Fri Oct 16, 2009 8:15 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Did you try moving some of the restrictions to filters?
You could use filters on top of Criteria or HQL, keeping both a bit simpler.
Or use Hibernate Search, and the FullTextFilters it provides, which provides better scalability and caching of sub-results, but is harder the map especially on Joins. Having to build matches on strings I would definitely go for that.

_________________
Sanne
http://in.relation.to/


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.