如果我有这样的事情
@Entity
public class Facility {
...
@ManyToOne
@JoinColumn(name="CUSTOMER_FK")
private Customer customer;
...
}
我@NameQuery
喜欢这个吗
@NamedQuery(name="Facility.findByCustomerId", query="select c from Facility c where c.customer=:customer_fk")
或者像这样
@NamedQuery(name="Facility.findByCustomerId", query="select c from Facility c where c.CUSTOMER_FK=:customer_fk")