I have 2 tables table A with ID and name table B with ID and name
i want to insert data in 3rd table which will contain ID from both the tables i.e tableC will have 2 columns : IDtableA IDTableB
In The mapping class of table A i am doing something like this @OneToOne @JoinTable(name = "TableA_X_TableB", joinColumns ={@JoinColumn(name = "TableBId")}) public B getB() { return b; } public void setB(B b) { this.b= b; }
when i call from the code A a = new A(); B b = new B(); service.persist(b); a.setB(b); service.persist(a);
I can see data in TableA , TableB but its not there in TableA_X_TableB which joins these two tables. Has anyone seen this before , i have no clue why its happening.
Any help in this will be appriciated.
Thanks,
|