mirror of
https://github.com/spring-projects/spring-security.git
synced 2026-02-07 14:04:48 +00:00
22 lines
576 B
Java
22 lines
576 B
Java
|
|
package bigbank;
|
||
|
|
|
||
|
|
import org.springframework.beans.factory.InitializingBean;
|
||
|
|
import org.springframework.util.Assert;
|
||
|
|
|
||
|
|
public class SeedData implements InitializingBean{
|
||
|
|
private BankDao bankDao;
|
||
|
|
|
||
|
|
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"));
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setBankDao(BankDao bankDao) {
|
||
|
|
this.bankDao = bankDao;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|