2007-12-14 02:27:48 +00:00
|
|
|
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;
|
2007-12-14 02:27:48 +00:00
|
|
|
|
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"));
|
|
|
|
|
}
|
2010-01-08 16:06:05 +00:00
|
|
|
|
2015-03-23 11:21:19 -05:00
|
|
|
public void setBankDao(BankDao bankDao) {
|
|
|
|
|
this.bankDao = bankDao;
|
|
|
|
|
}
|
2010-01-08 16:06:05 +00:00
|
|
|
|
2007-12-14 02:27:48 +00:00
|
|
|
}
|