Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
 }