It is not quite clear what the meaning of this annotation is when there is an @Table which clearly indicates which table is being linked with.
- How else would Hibernate determine that this class matches some tables? Checking for each class the presence of annotations in the fields? - etki
- @etki using the annotation "@Table we say Hibernate to which particular table you need to associate this class. - Vasili Anoshin
- oneThis is an optional summary, which may not be - etki
|
1 answer
The @Entity marks classes that are database entities. For example, if there is a User table in the database that contains a list of users, the User class, annotated with @Entity , must exist in Java, the object of this class will be the row of the User table. Often used in conjunction with the @Table annotation, which helps to explicitly identify some information about a table.
|