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