Skip to content
Advertisement

Tag: spring-data-jpa

Why is Spring telling me the controller is an unknown entity upon saving a user?

After a few hours of running against the wall with this code, I’ve just about had it. This error is as indescriptive as can be. My User entity: https://pastebin.com/fqRJmMCc TicketController controller with just the function that holds user info: https://pastebin.com/n7jeciAM User service and repository essentials: https://pastebin.com/acYUF7sN Long story short is that the User object should only need a mail address,

I get empty list from findAll Spring data and h2 data base while the database is not empty

I have a spring boot API project with h2 database. I added some data in the data.sql but the data wasn’t inserted into the database however tables are created successfully when I call the findAll API I get an empty list due to the database tables are empty. Application.properties data.sql Pom.xml Main Class Gateway.java Repository Controller project structure Answer Add

Advertisement