如何用多个where子句编写JPA查询

时间:2018-04-04 11:06:51

标签: jpa

如何将SQL查询转换为JPA以进行以下SQL查询。

SELECT * 
FROM commodity comm, 
     configuration config, 
     customer customer 
where comm.commodity_id = config.commodity_id 
  and customer.customer_id = config.customer_id 
  and customer.customer_id=2 ;

我在下面尝试但没有按预期工作,

@Query("SELECT commodity FROM Commodity commodity, SCConfig config, Customerdetails customer WHERE ( (commodity = config.commodity_id) and (customer = config.customer_id) and (config.customer_id = :customer_id) ) group by commodity)

提前感谢您的回复。

0 个答案:

没有答案