Guest User

Untitled

a guest
Feb 16th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. class writer {
  2. public void persistData() {
  3. // code to read file and created object for each table
  4. // size of file here is 3 so loop is running 3 times and table1Object
  5. // and table2Object and table3Object has rows to be inserted into
  6. // database table A,B,C
  7. for (int i = 0; i < 3; i++) {
  8. service.persistData(table1Object[i], table2Object, table3Oject[i]);
  9.  
  10. }
  11. }
  12. }
  13.  
  14. class service {
  15. @Transactional(propagation = Propagation.REQUIRED_NEW, readOnly = false)
  16. public void persistData(ob1,ob2,ob3){
  17. dao.insertionOrUpadteForTableA(ob1);
  18. dao.insertionOrUpadteForTableB(ob2);
  19. dao.insertionOrUpadteForTableC(ob3);
  20.  
  21. }
  22. }
Add Comment
Please, Sign In to add comment