0
如何使用JPA Criteria編寫以下MySQL查詢?具有常見customerId字段的JPA條件子查詢
select * from deptors where customerId in
(select customerId from address where zipcode="12345-6789")
and gender="male";
我已閱讀http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/Criteria#Subquery和許多計算器線程包括JPA 2.0, Criteria API, Subqueries, In Expressions。但我只是沒有得到它。感謝您的幫助。
對於'in'使用,也看看這個答案:http://stackoverflow.com/a/9325205/870122 – perissf