File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes @IdClass and @EmbeddedId Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "@IdClass and @EmbeddedId" Watch "@IdClass and @EmbeddedId" New topic

@IdClass and @EmbeddedId

nitin pai
Ranch Hand

Joined: May 30, 2006
Posts: 185
@EmbeddedId is a good way to work with composite primary keys. But why does @IdClass exist. It anyways introduces redundancies and can be error prone.

Can you cite any specific scenario where only @IdClass can be used and not @EmbeddedId?

I agree. Here's the link:
subject: @IdClass and @EmbeddedId
It's not a secret anymore!