Hello Naresh
I have saved Dept object ( parent).
To save an emp ( child ) object to the database, i am using dept.getEmps().add( emp). Here dept.getEmps() returns a Hash set.
parent and child, where??? i dont understand, in your mapping files i see a simple relation and looks good.
When i use hibernateTemplate.update(dept), emp is getting added to the database here. But when i use only hibernateAPI i.e. with out springs, with out using session.update(dept), emp is getting added to database. can you pls tell me the mistake in this application.
the correct way is using the "update method", mistake???, no exist i think so.
maybe this is wrong , long time ago that i dont work with hibernate alone,
i work with Spring/Hibernate
but i can remember and you see this behaviour: you can update into the db only with Hibernate without use update method, why??, this is a feature of Hibernate, automatic update into the dabase when the state of the object (values of the properties) is changed
in Spring not happens, you must use the hibernateTemplate
regards