Answer the question
In order to leave comments, you need to log in
Do Kotlin, lombok, and others follow the requirement that entity classes be identical?
I read the documentation here and find something strange:
https ://docs.jboss.org/hibernate/orm/5.5/userguide...
equals and hashCode will return different values for them.
However, hibernate has the concept of sessions and the Entity of the same record taken in different sessions (as you like) should always be the same:
So what's all the fuss? Normally, most Java objects provide a built-in equals() and hashCode() based on the object's identity, so each new object will be different from all others. This is generally what you want in ordinary Java programming. Conceptually, however, this starts to break down when you start to think about the possibility of multiple instances of a class representing the same data.
Answer the question
In order to leave comments, you need to log in
Of course they know about it and override equals and hashCode correctly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question