I guess this is easy, but I can't figure it out.
If I have entities Foo and Bar:
@Entity
class Foo{
@OneToMany
List<Bar> bars;
}
@Entity
class Bar{
@Column
int data;
}
and if I want to create a Join (javax.persistence.criteria.Join<Foo, Bar>
) object, I can do it like this:
Root<Foo> root = ...;
Join<Foo,Bar> join = root.join(Foo_.bars);
But how can I make an inverse join
Join<Bar,Foo> inverseJoin = barRoot.join....()...?
since I don't have a java field in the class Bar that points to it's Foo parent, it is unidirectional relation?