JPA/Hibernate "Composite-id class does not override equals()"
java, jpa
Solution
Because when entities don't have a composite ID, they have a single one, of one of the basic supported types (Integer, Long, String, etc.), and those classes already have a well-defined `equals()` (and `hashCode()`) method.
Problem
I'm using JPA and getting the following warning. I've researched this, and understand why I need to override it and how Hibernate uses these methods. I still have a question though: Exception: Composite-id class does not override equals() Question: Why does Hibernate only care about classes that don't have composite IDs? Does it by default compare on the `@Id` field if there is only one present, or is there something more complex going on here?