Saturday, August 9, 2014

Maven + Hibernate Session Save

Session session = HibernateUtil.getSessionFactory().openSession();
          session.beginTransaction();     
 
                InvDclStockCategory cat = new InvDclStockCategory();
  
                cat.setDescription(Name);
                cat.setInactive(Status);
                session.save(cat);
                session.getTransaction().commit();
                session.close();
               

No comments:

Post a Comment