public int insertChanDaoTaskModel(List<T> t) {
// TODO Auto-generated method stub

Session session = this.hibernateTemplate.getSessionFactory().openSession();
Transaction tran = session.beginTransaction();
tran.begin();
try {
for(int i=0;i<t.size();i++){
session.save(t.get(i));
if(i%2000==0){
session.flush();
session.clear();
}
}
tran.commit();
session.close();
return 1;
}
catch (Exception ex) {
// TODO: handle exception
return 0;
}
}

相关文章:

  • 2021-05-09
  • 2021-09-27
  • 2021-08-30
  • 2021-12-03
  • 2021-11-05
  • 2021-10-23
猜你喜欢
  • 2021-08-17
  • 2021-06-10
  • 2021-11-26
  • 2021-10-23
  • 2021-08-31
  • 2021-08-14
  • 2021-11-19
相关资源
相似解决方案