Would Spring Data Repository populator be able to pre load the databases using CSV data or what would be the best way to load CSV data in Spring Boot JPA repositories.
Asked
Active
Viewed 715 times
0
-
suppose you can write a method that populate the CSV data to the database on application start up using you can refer this [post](https://stackoverflow.com/questions/2401489/execute-method-on-startup-in-spring) about `@PostConstruct` annotation – Rajith Pemabandu Jul 20 '17 at 00:33
1 Answers
2
I'd use a CommandLineRunner (assuming you're using Spring Boot)
I've put together a small gist here: https://gist.github.com/jkupcho/a423bd26509adb08844642ad16e16115

dardo
- 4,870
- 4
- 35
- 52