public int update(Fda2 value) throws BoException { SqlSession session = null; int result = 0; try { session = SessionFactory.getSession(); Fda2Dao mapper = session.getMapper(Fda2Dao.class); result = mapper.update(value); session.commit(); } catch (Exception e) { session.rollback(); throw new BoException(e); } finally { if (session != null) session.close(); } return result; }
public Fda2 read(Long key) throws BoException { SqlSession session = null; Fda2 result; String where = "KEY='" + key + "' "; Map<String, Object> map = new HashMap<String, Object>(); map.put("where", where); try { session = SessionFactory.getSession(); Fda2Dao mapper = session.getMapper(Fda2Dao.class); result = mapper.read(map); session.commit(); } catch (Exception e) { session.rollback(); throw new BoException(e); } finally { if (session != null) session.close(); } return result; }