This should be possible using a @OneToMany
association with TABLE_B as a @JoinTable
:
@Entity
@Table(name="TABLE_A")
public class A {
@OneToMany
@JoinTable(
name="TABLE_B",
joinColumns = @JoinColumn( name="A_ID"),
inverseJoinColumns = @JoinColumn( name="B_ID")
)
public Set<C> cs;
}
@Entity
@Table(name="TABLE_C")
public class C {
}
This way entity A is directy linked to entity C, and the B's are only used as a join table.