如何为以下mysql创建休眠条件查询?
SELECT * FROM orders JOIN address ON address.id = orders.toaddress WHERE orders.id=7;
我尝试过这样的事情:
Criteria c1 =HibernateSession.createCriteria(s,Orders.class);
c1.setFetchMode("toaddress",FetchMode.JOIN);
List <Address> c = c1.list();
for (Address a: c) {
a.getAddress();
}
提前感谢所有帮助!