Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] @EmbeeddedId vs @IdClass

 
If you use an EmbeddedId, you are not required to specify the @Id or @Column on the pk fields, but you can if you want to map different values. If your Embeddable is shared you can use attribute overrides on the @EmbeddedId mapping.
 
Cheers,
Guy
----- Original Message -----
Sent: Thursday, December 17, 2009 4:28 PM
Subject: [eclipselink-users] @EmbeeddedId vs @IdClass

Is there any preference in which one to use when it comes to composite Primary Keys? I can see from the documentation that I can use either or, but I'm wondering which one is preferable.

And if I decide to use the @Embeddable annotation on my PrimaryKey class, and @EmbeddedId in my entity,  do I need to annotate the Pk fields with @Column and @Id?

Thanks for the help...

Chris Mathrusse
christopher.mathrusse@xxxxxxxxxx


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Back to the top