Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Object Relational Mapping
Criteria equivalent for select function
Joined: Aug 04, 2011
Oct 10, 2012 20:57:58
I'd like to know if there is a Criteria equivalent for this SQL:
select * from productCategories where businessId = (select business_id from businesses where domain = ?) order by name desc limit ?, ?;
I think I know how to do it in HQL but if there's some way to do it with Criteria I would prefer that. Thanks
Joined: Oct 01, 2007
Oct 11, 2012 06:42:31
You should be able to write anything you can write in JPQL in Criteria.
Here is some examples of sub-queries using the Criteria API.
Blog:Java Persistence Performance
I agree. Here's the link:
subject: Criteria equivalent for select function
inner query in hibernate
Hibernate query question
Possible to create this HQL equivalent using Hibernate Criteria?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014