0
Spring Data Repository populator能夠使用CSV數據預加載數據庫,或者在Spring Boot JPA存儲庫中加載CSV數據的最佳方式是什麼。來自CSV的Spring Data Repository Populator
Spring Data Repository populator能夠使用CSV數據預加載數據庫,或者在Spring Boot JPA存儲庫中加載CSV數據的最佳方式是什麼。來自CSV的Spring Data Repository Populator
我會使用一個CommandLineRunner(假設你使用Spring引導)
我已經把一個小的要點在這裏: https://gist.github.com/jkupcho/a423bd26509adb08844642ad16e16115
想你可以寫一個CSV數據填充的方法應用程序上的數據庫啓動使用你可以參考這個[post](https://stackoverflow.com/questions/2401489/execute-method-on-startup-in-spring)關於'@ PostConstruct'註釋 –