Is it possibile to define somehow a relationship based on a status column?
Table A: id, valueA
Table B: id, refIdA, valueB, status
So in class A I would like to fetch only B where the status is active. Fetching with em.find(id, A.class)
. Is there way to define that within the entity?
@Entity
public class A {
...
@OneToMany
@JoinColumn(name = "refIdA")
private List<B> b;
...
}