I have spring boot application with JPA and MySQL. The table is already created and data are present. From the spring boot application, we need to create two API - get a particular record using id and get all the records. I created a model class but confused with usage of @Entity
. Because I'm not going to insert/delete a record from the database. I want to use only for select the record.
For Select query (findBy
), do we need to use @Entity
annotation at the top of model class?