How to delete an object in Hibernate? In my program I have to write program to delete the data using Hibernate framework. I want to delete one row of data who's primary key is known to me.
What will be the code?
You can use the Session.delete() method of the Session object.
Here is the sample code:
//Delete the object session.delete(emp);
Check the tutorial Hibernate Session.delete() Example for the complete code example.