Code example for Session

Methods: getupdate

0
   public void updateAccountBranch(Integer id, String branch) throws Exception {
      log.debug("Updating account " + id + " to branch " + branch);
      tm.begin();
      try { 
         Session session = sessionFactory.getCurrentSession();
         Object account = session.get(acctClass, id);
         log.debug("Set branch " + branch);
         setBranch.invoke(account, branch);
         session.update(account);
         tm.commit();
      } catch (Exception e) {
         log.error("rolling back", e);
         tm.rollback();
         throw e;
      } 
      log.debug("Updated account " + id + " to branch " + branch);
   } 
 
   public int getCountForBranch(String branch, boolean useRegion) throws Exception {
      tm.begin();
Connect your IDE to all the code out there  Get Codota for Java