0
I’m developing an application Rest API using Spring Boot.
Doubt:
If I already have a Database in production with populated tables it is necessary to create the Entity class with the annotation anyway @Entity
.
If yes, you need to include all fields in this table in this class ?
Yes Juliano, the @Entity is for the model class to work with
javax.persistence.Entity
, without this it will not understand that that class is part of something, is to persist, has nothing to do with generating the database (of course you can sethbm2ddl.auto
like "create" in Latin, but that’s another story)– Guilherme Nascimento