List of usage examples for org.apache.ibatis.session SqlSession flushStatements
List<BatchResult> flushStatements();
From source file:ph.fingra.hadoop.dbms.parts.component.service.ComponentUserServiceImpl.java
License:Apache License
public int insertBatchComponentUserDay(List<CompoUserAll> in_volist) throws Exception { if (in_volist == null) { return 0; }//from w ww. j a v a2s . c o m SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); ComponentUserDao dao = session.getMapper(ComponentUserDao.class); boolean has_error = false; try { if (in_volist != null) { Iterator<CompoUserAll> it = in_volist.iterator(); while (it.hasNext()) { CompoUserAll insert = it.next(); dao.insertCompoUserDay(insert); } } List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }
From source file:ph.fingra.hadoop.dbms.parts.component.service.ComponentUserServiceImpl.java
License:Apache License
public int deleteComponentUserDayByDate(String year, String month, String day) throws Exception { SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); ComponentUserDao dao = session.getMapper(ComponentUserDao.class); boolean has_error = false; try {// www. ja v a 2 s .c o m dao.deleteCompoUserDayByKey(year, month, day, "", ""); List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }
From source file:ph.fingra.hadoop.dbms.parts.component.service.ComponentUserServiceImpl.java
License:Apache License
public int insertBatchComponentUserWeek(List<CompoUserAll> in_volist) throws Exception { if (in_volist == null) { return 0; }/*from www . j av a 2s .c o m*/ SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); ComponentUserDao dao = session.getMapper(ComponentUserDao.class); boolean has_error = false; try { if (in_volist != null) { Iterator<CompoUserAll> it = in_volist.iterator(); while (it.hasNext()) { CompoUserAll insert = it.next(); dao.insertCompoUserWeek(insert); } } List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }
From source file:ph.fingra.hadoop.dbms.parts.component.service.ComponentUserServiceImpl.java
License:Apache License
public int deleteComponentUserWeekByDate(String year, String week) throws Exception { SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); ComponentUserDao dao = session.getMapper(ComponentUserDao.class); boolean has_error = false; try {//w w w. jav a 2 s. c om dao.deleteCompoUserWeekByKey(year, week, "", ""); List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }
From source file:ph.fingra.hadoop.dbms.parts.component.service.ComponentUserServiceImpl.java
License:Apache License
public int insertBatchComponentUserMonth(List<CompoUserAll> in_volist) throws Exception { if (in_volist == null) { return 0; }// w w w. ja v a 2s.c om SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); ComponentUserDao dao = session.getMapper(ComponentUserDao.class); boolean has_error = false; try { if (in_volist != null) { Iterator<CompoUserAll> it = in_volist.iterator(); while (it.hasNext()) { CompoUserAll insert = it.next(); dao.insertCompoUserMonth(insert); } } List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }
From source file:ph.fingra.hadoop.dbms.parts.component.service.ComponentUserServiceImpl.java
License:Apache License
public int deleteComponentUserMonthByDate(String year, String month) throws Exception { SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); ComponentUserDao dao = session.getMapper(ComponentUserDao.class); boolean has_error = false; try {//from w ww .jav a 2 s .com dao.deleteCompoUserMonthByKey(year, month, "", ""); List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }
From source file:ph.fingra.hadoop.dbms.parts.distribution.service.AppversionServiceImpl.java
License:Apache License
public int insertBatchAppversionDay(List<AppversionAll> in_volist) throws Exception { if (in_volist == null) { return 0; }/*ww w.j a va 2 s .c o m*/ SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); AppversionDao dao = session.getMapper(AppversionDao.class); boolean has_error = false; try { if (in_volist != null) { Iterator<AppversionAll> it = in_volist.iterator(); while (it.hasNext()) { AppversionAll insert = it.next(); dao.insertAppversionDay(insert); } } List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }
From source file:ph.fingra.hadoop.dbms.parts.distribution.service.AppversionServiceImpl.java
License:Apache License
public int deleteAppversionDayByDate(String year, String month, String day) throws Exception { SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); AppversionDao dao = session.getMapper(AppversionDao.class); boolean has_error = false; try {/*from w ww.j a va 2s. com*/ dao.deleteAppversionDayByKey(year, month, day, "", ""); List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }
From source file:ph.fingra.hadoop.dbms.parts.distribution.service.AppversionServiceImpl.java
License:Apache License
public int insertBatchAppversionWeek(List<AppversionAll> in_volist) throws Exception { if (in_volist == null) { return 0; }//ww w . j a v a2 s . c o m SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); AppversionDao dao = session.getMapper(AppversionDao.class); boolean has_error = false; try { if (in_volist != null) { Iterator<AppversionAll> it = in_volist.iterator(); while (it.hasNext()) { AppversionAll insert = it.next(); dao.insertAppversionWeek(insert); } } List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }
From source file:ph.fingra.hadoop.dbms.parts.distribution.service.AppversionServiceImpl.java
License:Apache License
public int deleteAppversionWeekByDate(String year, String week) throws Exception { SqlSession session = ConnectionFactory.getSession().openSession(ExecutorType.BATCH, false); AppversionDao dao = session.getMapper(AppversionDao.class); boolean has_error = false; try {//from www. j a va2 s. com dao.deleteAppversionWeekByKey(year, week, "", ""); List<BatchResult> results = session.flushStatements(); results.clear(); } catch (Exception e) { has_error = true; session.rollback(); session.close(); throw e; } finally { if (has_error == false) session.commit(); session.close(); } return (has_error == false) ? 1 : 0; }