I have two tables HEADER and DESCRIPTION. description id is one of the non key column in the table HEADER and which is part of primarykey along with language id in DESCRIPTION. How do I need map this in Header.hbm.xml file to support CRUD operations. Please provide solution if any body faced the similar situation.
we can acheive this by using following mapping in Header.hbm.xml
I am able to save and retrive, update in one hibernate save/get/update operation but delete is not working.
When I tried to delete it is trying to update DescriptionId as a null in DESCRIPTION table where DescriptionId is part of the primarykey. AS a work around I have written one native sql query to delete DESCRIPTION records. I am looking for better solution to delete descriptions along with header object in one hibernate call.