multiple @id annotations in a single entity

BlueSky picture BlueSky · May 30, 2011 · Viewed 12k times · Source

What is the difference between using multiple @Id in an entity Vs, Composite Id ?

Also, how does this @EmbeddedId work when there is no table actually created separately for the Embedded Object?

Answer

JB Nizet picture JB Nizet · May 31, 2011

Hibernate offers different options for defining/using composite identifiers. All these options are explained in depth in the hibernate reference manual: http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#d0e4819.