initScript("com/scripts/account-init.sql");
}
public void testExecutebatchDetailed() {
List accountList1 = new ArrayList();
Account account = new Account();
account.setId(10);
account.setFirstName("fred");
account.setLastName("flintstone");
account.setEmailAddress("fred.flintstone@gmail.com");
accountList1.add(account);
account = new Account();
account.setId(11);
account.setFirstName("fred");
account.setLastName("flintstone");
account.setEmailAddress("fred.flintstone@gmail.com");
accountList1.add(account);
account = new Account();
account.setId(12);
account.setFirstName("fred");
account.setLastName("flintstone");
account.setEmailAddress("fred.flintstone@gmail.com");
accountList1.add(account);
account = new Account();
account.setId(13);
account.setFirstName("fred");
account.setLastName("flintstone");
account.setEmailAddress("fred.flintstone@gmail.com");
accountList1.add(account);
account = new Account();
account.setId(14);
account.setFirstName("fred");
account.setLastName("flintstone");
account.setEmailAddress("fred.flintstone@gmail.com");
accountList1.add(account);
List accountList2 = new ArrayList();
account = new Account();
account.setId(15);
account.setFirstName("fred");
account.setLastName("flintstone");
account.setEmailAddress("fred.flintstone@gmail.com");
accountList2.add(account);
account = new Account();
account.setId(16);
account.setFirstName("fred");
account.setLastName("flintstone");
account.setEmailAddress("fred.flintstone@gmail.com");
accountList2.add(account);
account = new Account();
account.setId(17);
account.setFirstName("fred");
account.setLastName("flintstone");
account.setEmailAddress("fred.flintstone@gmail.com");
accountList2.add(account);
account = new Account();
account.setId(18);
account.setFirstName("fred");
account.setLastName("flintstone");
account.setEmailAddress("fred.flintstone@gmail.com");
accountList2.add(account);
try {
sqlMap.startTransaction();
sqlMap.startBatch();
// insert 5 accounts
for (int i = 0; i < accountList1.size(); i++) {
sqlMap.insert("insertAccountViaInlineParameters", accountList1.get(i));
}
// update 1 account
account = new Account();
account.setId(10);
account.setFirstName("barney");
account.setLastName("rubble");
account.setEmailAddress("barney.rubble@gmail.com");
sqlMap.update("updateAccountViaInlineParameters", account);
// insert 4 accounts
for (int i = 0; i < accountList2.size(); i++) {