Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class writer {
- public void persistData() {
- // code to read file and created object for each table
- // size of file here is 3 so loop is running 3 times and table1Object
- // and table2Object and table3Object has rows to be inserted into
- // database table A,B,C
- for (int i = 0; i < 3; i++) {
- service.persistData(table1Object[i], table2Object, table3Oject[i]);
- }
- }
- }
- class service {
- @Transactional(propagation = Propagation.REQUIRED_NEW, readOnly = false)
- public void persistData(ob1,ob2,ob3){
- dao.insertionOrUpadteForTableA(ob1);
- dao.insertionOrUpadteForTableB(ob2);
- dao.insertionOrUpadteForTableC(ob3);
- }
- }
Add Comment
Please, Sign In to add comment