Collection lBanks = lBankSession.getBanks();
Iterator i = lBanks.iterator();
while( i.hasNext() ) {
BankData lBank = (BankData) i.next();
// Get all customers
CustomerSession lCustomerSession = lCustomerHome.create();
Collection lCustomers = lCustomerSession.getCustomers( lBank.getId() );
Iterator j = lCustomers.iterator();
while( j.hasNext() ) {
CustomerData lCustomer = (CustomerData) j.next();
// Get all accounts
AccountSession lAccountSession = lAccountHome.create();
Collection lAccounts = lAccountSession.getAccounts( lCustomer.getId() );
Iterator k = lAccounts.iterator();
while( k.hasNext() ) {
AccountData lAccount = (AccountData) k.next();
lAccountSession.removeAccount( lAccount.getId() );
}
lCustomerSession.removeCustomer( lCustomer.getId() );
}
lBankSession.removeBank( lBank.getId() );
}
log.debug( "setUp() ends" );
}