22 lines
575 B
Java
Raw Normal View History

package bigbank;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
2015-03-23 11:21:19 -05:00
public class SeedData implements InitializingBean {
private BankDao bankDao;
2015-03-23 11:21:19 -05:00
public void afterPropertiesSet() throws Exception {
Assert.notNull(bankDao);
bankDao.createOrUpdateAccount(new Account("rod"));
bankDao.createOrUpdateAccount(new Account("dianne"));
bankDao.createOrUpdateAccount(new Account("scott"));
bankDao.createOrUpdateAccount(new Account("peter"));
}
2015-03-23 11:21:19 -05:00
public void setBankDao(BankDao bankDao) {
this.bankDao = bankDao;
}
}