Hi, I'm having some issues with a Many To Many Mapping. I have two Tables (TABLE1, TABLE2) each having a Primary Key named ID and another Column named NUMBER. Additionally I have a Join Table (TABLE1_TABLE2) with two columns NUMBER1 and NUMBER2. What I want is a Many To Many Join using the NUMBER columns and not the ID columns. I tried this, but it's not working...it always uses the ID columns no matter what I try.
@ManyToMany @JoinColumn(name="NUMBER", referencedColumnName="NUMBER") @JoinTable(joinColumns=@JoinColumn(name="NUMBER1"), inverseJoinColumns=@JoinColumn(name="NUMBER2"))
and
@ManyToMany @JoinColumn(name="NUMBER") @JoinTable(joinColumns=@JoinColumn(name="NUMBER1"), inverseJoinColumns=@JoinColumn(name="NUMBER2", referencedColumnName="NUMBER"))
I can't find anything about this usecase for a Many To Many Mapping. Hopefully somebody of you can help me. Frank
|