mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 09:12:14 +00:00
22 lines
576 B
Java
Executable File
22 lines
576 B
Java
Executable File
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;
|
|
}
|
|
|
|
}
|