Employee Table hbm definition will have the following
Address Table hbm definition will have the following
Currently the application throws the following exception when execute the following HQL query
from Address where primarykey = '1232';
More than one row with the given identifier was found: 1232, for class:
com.region.Employee (compact stack trace follows)
1. Will Address primary key will always have one similar primary key in Employee?
2. Will the Address primary key might differs from Employee primary key column
3. Will the Address primary key will always have one similar address column value in Employee table?
4. When this issue might come?
5. How to fix the problem
Please refer hibernate in action page number 221. Many to one is really a one-to-one. We have defined so that it works properly. please go through the PDF 221 for more info - cpe.ku.ac.th/~plw/oop/e_book/hibernate_in_action.pdf