File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java SE 8 for the Really Impatient
this week in the
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
It is sorta covered in the
JavaRanch Style Guide
subject: Criteria equivalent for select function
Hibernate query question
inner query in hibernate
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