我有 3 个表,每个表都映射到一个实体。实体是这样的:
@Entity
@Table(name = "person")
public class Person implements Serializable {
private int id;
//other fields
}
@Entity
@Table(name = "phone")
public class Phone implements Serializable {
private int id;
private Long price;
@ManyToOne
@JoinColumn(name = "personId")
private Person person;
@ManyToOne
@JoinColumn(name = "manufacturerId")
private Manufacturer manufacturer;
//other fields
}
@Entity
@Table(name = "manufacturer")
public class Manufacturer implements Serializable {
private int id;
private String name;
//other fields
}
我想要做的是创建一个方法,该方法将返回具有指定制造商的电话且价格在指定范围内的人员列表。
编辑:我的 dao 类实现 EntityJpaDao 。我需要一个可以与此实现一起使用的解决方案。