Saturday, August 9, 2014

Maven + Hibernate Session Update

      Session session = HibernateUtil.getSessionFactory().openSession();
          session.beginTransaction();     
 InvDclStockCategory cat = InvDclStockCategory)session.get(InvDclStockCategory.class, Id);
  
                cat.setDescription(Name);
                cat.setInactive(Status);
                
                session.update(cat);
                session.getTransaction().commit();
                session.close();

No comments:

Post a Comment