How do I write the following MySQL query using JPA Criteria?
select * from deptors where customerId in
(select customerId from address where zipcode="12345-6789")
and gender="male";
I have read http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/Criteria#Subquery and many stackoverflow threads including JPA 2.0, Criteria API, Subqueries, In Expressions. But I am just not getting it. Thanks for helping.