Hibernate framework @Embedded, @Embeddable and @ElementCollection annotations (Class 3)

preview_player
Показать описание
The @Embedded annotation is used to specify the Address entity should be stored in the STUDENT table as a component. @Embeddable annotation is used to specify the Address class will be used as a component. The Address class cannot have a primary key of its own, it uses the enclosing class primary key.

In Hibernate Annotation, @ElementCollection is the feature which gets the columns values from another table without mapping two tables. We have taken two entity student and college. In college entity, we will fetch students without mapping student and college entity
Рекомендации по теме