/**
 * 
 */
package roseindia;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;

/**
 * @author Administrator
 *
 */
public class DeleteData {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		 
		SessionFactory sessFact = HibernateUtil.getSessionFactory();
		Session sess = sessFact.getCurrentSession();
		Transaction tr = sess.beginTransaction();
		Student st = (Student)sess.load(Student.class,3);
		sess.delete(st);
		System.out.println("Deleted Successfully");
		tr.commit();
		sessFact.close();

	}

}
