Thursday, January 22, 2015

When to model entity objects over Embedded objects

Hi ,
Would like to know why we might possible use @Embedded over @Entity
In certain scenarios it looks like we can use or model an @Embedded object as an Entity?
1. @Embedded objects might not have a primary key, if you not willing to waste a primary key or does not stand alone, rather dependent on another identity which means does not make sense without that entity, that means its an @Embedded object rather than an Entity

http://stackoverflow.com/questions/8969059/difference-between-onetomany-and-elementcollection

http://stackoverflow.com/questions/3418683/jpa-when-to-choose-multivalued-association-vs-element-collection-mapping

No comments:

Post a Comment