List of usage examples for org.apache.ibatis.session SqlSession close
@Override
void close();
From source file:com.inform.project.dao.MyBatisGetCategoryImpl.java
@Override public List<UserCategoryModel> getListCategory() { List<UserCategoryModel> list = null; SqlSession session = null; try {// w w w.j a va2s.c o m session = MyBatisSession.getInst().getSession().openSession(); list = session.selectList("GetUsersCategoryMapper.getCategoryList"); } catch (IOException ex) { Logger.getLogger(MyBatisGetEventsImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } return list; }
From source file:com.inform.project.dao.MyBatisGetCategoryImpl.java
@Override public void setCategory(UserCategoryModel category) { SqlSession session = null; try {// ww w .j av a 2s . c o m session = MyBatisSession.getInst().getSession().openSession(); session.insert("GetUsersCategoryMapper.insertOne", category); session.commit(); } catch (IOException ex) { Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } }
From source file:com.inform.project.dao.MyBatisGetCategoryImpl.java
@Override public void delCategory(UserCategoryModel category) { SqlSession session = null; try {/*from w ww .jav a2s .co m*/ session = MyBatisSession.getInst().getSession().openSession(); session.delete("GetUsersCategoryMapper.deleteOne", category); session.commit(); } catch (IOException ex) { Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } }
From source file:com.inform.project.dao.MyBatisGetCategoryImpl.java
@Override public void updCategory(UserCategoryModel category) { SqlSession session = null; try {//from w w w . ja v a 2 s . c om session = MyBatisSession.getInst().getSession().openSession(); session.update("GetUsersCategoryMapper.updateOne", category); session.commit(); } catch (IOException ex) { Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } }
From source file:com.inform.project.dao.MyBatisGetEventsImpl.java
@Override public List<UserEventModel> getEvents() { List<UserEventModel> list = null; SqlSession session = null; try {/*w w w . ja v a 2 s . com*/ session = MyBatisSession.getInst().getSession().openSession(); list = session.selectList("GetEventsMapper.getEventsList"); } catch (IOException ex) { Logger.getLogger(MyBatisGetEventsImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } return list; }
From source file:com.inform.project.dao.MyBatisGetEventsImpl.java
@Override public void addEvent(EventModel event) { SqlSession session = null; try {//w w w . j a va 2 s.c o m session = MyBatisSession.getInst().getSession().openSession(); session.insert("GetEventsModelMapper.insertOne", event); session.commit(); } catch (IOException ex) { Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } }
From source file:com.inform.project.dao.MyBatisGetEventsImpl.java
@Override public void saveEdit(EventModel event) { SqlSession session = null; try {// w w w. j a va2s.c o m session = MyBatisSession.getInst().getSession().openSession(); session.update("GetEventsModelMapper.updateOne", event); session.commit(); } catch (IOException ex) { Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } }
From source file:com.inform.project.dao.MyBatisGetEventsImpl.java
@Override public void deleteEvent(EventModel event) { SqlSession session = null; try {//from w w w . j av a2 s. co m session = MyBatisSession.getInst().getSession().openSession(); session.delete("GetEventsModelMapper.deleteOne", event); session.commit(); } catch (IOException ex) { Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } }
From source file:com.inform.project.dao.MyBatisGetEventsImpl.java
@Override public List<UserEventModel> getEventForEventName(UserEventModel event) { List<UserEventModel> list = null; SqlSession session = null; try {/* w w w .jav a2s . co m*/ session = MyBatisSession.getInst().getSession().openSession(); list = session.selectList("GetEventsMapper.getListForEventName", event); } catch (IOException ex) { Logger.getLogger(MyBatisGetEventsImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } return list; }
From source file:com.inform.project.dao.MyBatisGetEventsImpl.java
@Override public List<UserEventModel> getEventForLocation(UserEventModel event) { List<UserEventModel> list = null; SqlSession session = null; try {//w ww. ja v a 2 s. c o m session = MyBatisSession.getInst().getSession().openSession(); list = session.selectList("GetEventsMapper.getListForLocation", event); } catch (IOException ex) { Logger.getLogger(MyBatisGetEventsImpl.class.getName()).log(Level.SEVERE, null, ex); } finally { if (session != null) { session.close(); } } return list; }