I am working on jhipster Release 0.7.0 and i want to add data in in-memory database.

There is a way to add data using CSV file.

But i need to do it using java so is there any other option to add data in database by using java classes ?

有帮助吗?

解决方案

The "normal" way to do it is using Liquibase, using the files in your /src/main/resources/config/liquibase directory.

If you want to do it directly in Java, the easiest way would be to use JPA, using your JPA Repositories. Have a look at the methods provided by Spring Data JPA, if you call one of the sample repositories.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top