Saturday, August 9, 2014

Maven + Hibernate Session Delete

 Session session = HibernateUtil.getSessionFactory().openSession();
            session.beginTransaction();     
   
                Student userAdd =  (Student)session.get(Student.class, Id);
             
                session.delete(userAdd);
                session.getTransaction().commit();
                session.close();

No comments:

Post a Comment