This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am wondering how can you have one to one relationship between the two tables, if the PK of one table is mapped to the "part" of the PK of the other table, as in your case.
Doesn't it became a many-to-one relationship?
Joined: Feb 27, 2006
Rahul Actually there are 2 relationship between Table1 and Table2 <one-to-one> and <one-to-many>
It is the same case as described in "Java Persistence With Hibernate book" : Item and Bid classes.
The problem is not of association, the main query is
" i want different joins for save() and get() respectively..... This is possible in JDBC but how i can achieve samething in Hibernate ?"
Joined: Jun 28, 2008
I am not sure how you can get around this problem.
You may want to create a view from the two tables, and make its definition in such a way that the view returns whatever you are trying to select.
Save() operation on the table should remain the same...