请如何在 Hibernate 查询或条件中编写这个简单的工作选择
SELECT * FROM `call` AS c JOIN `event_customer` AS e ON c.customer_id = e.customer_id WHERE e.dgdelete = FALSE AND c.eventruletype_id = 1 AND e.event_id = 74 AND c.callactivity_id = 3 AND e.calltype = 2
我已经找到了很多建议,但没有任何帮助。
它可能与休眠映射有关?
谢谢你。
ps:这个不行
query = session.createQuery("select c from " + Call.class.getSimpleName()+ " as c " + EventCustomer.class.getSimpleName()+ " as e where e.customer_id = c.customer_id and e.event_id = 74");
这也不起作用
query = session.createQuery("select c from " + Call.class.getSimpleName()+ " as c join " + EventCustomer.class.getSimpleName()+ " as e where e.customer_id = c.customer_id and e.event_id = 74");
还有这个
query = session.createQuery("select c from " + Call.class.getSimpleName()+ " as c join " + EventCustomer.class.getSimpleName()+ " as e on e.customer_id = c.customer_id where e.event_id = 74");
还有这个
query = session.createQuery("select c from " + Call.class.getSimpleName()+ " as c left join " + EventCustomer.class.getSimpleName()+ " as e on e.customer_id = c.customer_id where e.event_id = 74");
在某些情况下,我会收到此错误