Skip to content
Advertisement

Spring Data Jpa Repository not saving entities to database

Im having some difficulties using jpa. Im not getting any exceptions, but I cant save anything to the database. I went from Hibernate to Jpa and everything worked perfectly there. Below are my Files

application.properties:

JavaScript

Model:

JavaScript

Repository:

JavaScript

Service:

JavaScript

I’m getting a 200 Response when submitting the form, but can’t find the data in the database

Advertisement

Answer

You are using a run time database(H2) so when you are calling APi data is showing from memory. No data is persisted in actual database. To persist the data in actual database you need to set the below properties with actual database url and driver

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement