【发布时间】:2019-11-18 08:11:26
【问题描述】:
我有一个实体叫 Unit,另一个叫 PriceElement
在哪里
@Entity
public class Unit {
//
@OneToMany(mappedBy = "unit", cascade = CascadeType.ALL, orphanRemoval = true)
private Set<PriceElement> priceElements;
}
@Entity
public class PriceElement {
//
private Integer total;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "unit_Id")
private Unit unit;
}
我想过滤特定范围之间的 priceElements 总属性总和的单位
【问题讨论】:
标签: hibernate jpa spring-data-jpa jpa-2.0 jpa-2.1