jdbctemp 事务
for(int i=0;i< list.size();i++){
Map recordMap=(Map)list.get(i);
System.out.println(" ================= Record ===== " + recordMap);
int pkKey= Integer.parseInt(recordMap.get("id").toString());
//update chirldren order with parent id
List childrenList=jdbcTemp.queryForList(childrenSql,new Object[]{iBookId,pkKey});
if(childrenList!=null){
for(int j=0;j< childrenList.size();j++){
Map childrenRecordMap=(Map)list.get(j);
System.out.println("=================children Record ===== " + childrenRecordMap);
int childrenPKKey= Integer.parseInt(childrenRecordMap.get("id").toString());
jdbcTemp.update(updateOrderSql,new Object[]{j+2,childrenPKKey});
}
}
//update parent order id.
jdbcTemp.update(updateOrderSql,new Object[]{i+2,pkKey});
}
out.println(" book_id==== ["+sBookId+"] had not entry! ");
}
}catch(org.springframework.dao.DataAccessException ex){