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?
|