2007-12-14 02:27:48 +00:00
|
|
|
package bigbank;
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
|
|
|
|
public class SeedData implements InitializingBean{
|
2008-12-20 00:16:49 +00:00
|
|
|
private BankDao bankDao;
|
2007-12-14 02:27:48 +00:00
|
|
|
|
2008-12-20 00:16:49 +00: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
|
|
|
|
2008-12-20 00:16:49 +00: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
|
|
|
}
|