Pergunta

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 ?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top