You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
633 B
21 lines
633 B
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; |
|
} |
|
|
|
}
|
|
|