假设我有这两个实体:
@Entity
class A {
@OneToMany(mappedBy = "a")
private Collection<B> bCollection;
...
}
@Entity
class B {
@ManyToOne
@JoinColumn(name = "aId")
private A a;
private boolean restricted;
...
}
我的问题是:我该怎么做才能只获取restricted = false
A.bCollection 中的 B 实体?