public Session openSession() {
   session = HibernateUtil.getSessionFactory().openSession();
   return session;
 }
 public Session getSession() {
   if (session == null) {
     session = HibernateUtil.getSessionFactory().getCurrentSession();
   }
   return session;
 }