예제 #1
0
 public MessageDetailsVO getMessageById(long id) throws Exception {
   SqlSession session = ConnectionFactory.getSession().openSession();
   MessageDetailsDAO dao = session.getMapper(MessageDetailsDAO.class);
   MessageDetailsVO messageDetailsVO = dao.getMessageById(id);
   session.close();
   return messageDetailsVO;
 }
예제 #2
0
 public List<MessageDetailsVO> getMessages() throws Exception {
   SqlSession session = ConnectionFactory.getSession().openSession();
   MessageDetailsDAO dao = session.getMapper(MessageDetailsDAO.class);
   List<MessageDetailsVO> users = dao.getAllMessages();
   session.close();
   return users;
 }
예제 #3
0
 public int deleteMessage(MessageDetailsVO vo) throws Exception {
   SqlSession session = ConnectionFactory.getSession().openSession();
   MessageDetailsDAO dao = session.getMapper(MessageDetailsDAO.class);
   int cnt = dao.doDeleteMessage(vo);
   session.commit();
   session.close();
   return cnt;
 }
예제 #4
0
 public MessageDetailsVO updateMessage(MessageDetailsVO vo) throws Exception {
   SqlSession session = ConnectionFactory.getSession().openSession();
   MessageDetailsDAO dao = session.getMapper(MessageDetailsDAO.class);
   dao.doUpdateMessage(vo);
   session.commit();
   session.close();
   return vo;
 }