hibernate composite key
Hibernate needs to be able to compare and serialize identifiers. So the identifier class must be serializable, and override hashCode() and equals() consistently with the database’s notion of composite key equality. If you have a composite id mapped as properties of the entity, the entity itself is the identifier. A second approach is called a … Read more