Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Hibernate - Interview Questions and Answers for 'Entity annotations' - 2 question(s) found - Order By Newest | ||||
| ||||
Ans. The first annotation will try to map the Class with the Table as of same name as Class whereas the second annotation will specify the Entity name as "EMPLOYEES" and hence will try to map with Table Name "EMPLOYEES". | ||||
![]() | ||||
![]() ![]() ![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() @Entity ( name ="EMPLOYEES") @Entity @Table ( name=""EMPLOYEES"" ) @Entity ( name="EMP") @Table ( name="EMPLPYEES" ) | ||||
| ||||
Ans. First Annotation will set the Entity name as EMPLOYEES and hence will try to map with the same Table name. The second annotation will make the Entity mapped to table EMPLOYEES irrespective of the Entity Name ( which is class name in this case ). Third Annotations will set the different names for Enitity and Table and will explicitly map them. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
![]() | ||||
![]() @Entity @Entity ( name="EMPLOYEES" ) | ||||