This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
In table A, there is a foreign key of Table B, called idfkb
And the object design is
I would like to insert an A record into the database with the existence of B record.
When I call hibernateTemplate.saveOrUpdate(A record), it throws exception that there is a duplicate value constraints. I believe the reason is because B record is already exist in B table, and the method saveOrUpdate will insert a record into A table and also insert the child record into B table.
For this scenario, is there any alternatives to insert A record with the existence of B record? please help.