Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Embeddable Class

 
Tony romer
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,
Is class with @Embeddable annotation on the top can be considered as Entity class?

Thanks
 
Deepika Joshi
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, NO.

@Embeddable is used for two cases,
-@EmbeddedId
-@Embeded

Embeddable can not have PK (because nested embedding is not allowed), so it can not be an Entity (Entity must have PK).

Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!