Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. @Component
  2. public class DataBaseLoader implements CommandLineRunner {
  3.  
  4. private final AccountRepository accounts;
  5.  
  6. @Autowired
  7. public DataBaseLoader(AccountRepository accountRepository) {
  8. this.accounts = accountRepository;
  9. }
  10.  
  11. @Override
  12. public void run(String... strings) throws Exception {
  13.  
  14. this.accounts.save(new Account("Banco Pelado", 1));
  15. this.accounts.save(new Account("CC Banco do Brasil", 1));
  16. this.accounts.save(new Account("PP Banco do Brasil", 1));
  17.  
  18. this.accounts.save(new Account("Banco Pelado", 1));
  19. this.accounts.save(new Account("Box Bank", 1));
  20. this.accounts.save(new Account("Carteira", 1));
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement