@Embeddable and @Embedded in Hibernate Annotation

Before jumping to @Embeddable and @Embedded annotation. Let me explain about hibernate different objects: Entity Object o Entity object are those object which can stand alone like Student or Professor and has its own database identity. Value Object o Objects which cannot stand alone like Address as you need to map address with some Entities like Student. It will belongs to an entity, and its persistent state is embedded in the table row of the owning entity In short, always use @Embeddable for the value object and @Embedded with the entity class. Let's understand it by a simple example: We have one Address (Value object) and it is having attributes like city, state, zip code. Now we have two more different entity Student and Professor (Entity Object) . Student or Professor can have Address attributes just by embedding the Address into its Entity. The @Embedd...