mybatis 批量操作
SqlSessionFactory sqlSessionFactory=getSqlSessionFactory();
//可以执行批量操作的sqlSession
SqlSession openSession=sqlSessionFactory.openSession(ExecutorType.BATCH);
try{
Entity mapper = openSession.getMapper(Entity.class);
for (int i = 0; i < 1000; i++) {
mapper.addEmp(new Entity());
}
openSession.commit();
}finally{
openSession.close();
}