• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@EmbeddedId / equals() / hashCode()

 
Alexandre Fradin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Here an excerpt of persistence specs (2.1.4) :

The primary key class must define equals and hashCode methods. The semantics of value
equality for these methods must be consistent with the database equality for the database types
to which the key is mapped.

In case of @IdClass, the primary key class have to implement equals() and hashCode() methods.

For @EmbeddedId which class have to implement those methods, entity or embedded class?


Thanks for help.
[ August 11, 2008: Message edited by: Alexandre Fradin ]
 
krishna bulusu
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class with @Embeddable annotation i.e. Embeddable class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic