I'm going to be a "small government" candidate. I'll be the government. Just me. No one else.
I'm going to be a "small government" candidate. I'll be the government. Just me. No one else.
In JPA, you might have multiple versions of the same database row in memory in different objects. Like if you fetch a row and make changes to it. The only way that JPA can distinguish between the "before" and "after" versions of that row - instead of confusing them with other rows in the database is to consider them as the same row (equals) by comparing ONLY the keys of that object. Since hashCode must track equals(), that means customizing hashCode to hash only on the key field(s) as well.
Mike Gosling wrote:
This is probably correct, but I don't think that is the reason why I'm getting error above. Project is two and a half year in production without hash and equals.
I'm going to be a "small government" candidate. I'll be the government. Just me. No one else.
I'm going to be a "small government" candidate. I'll be the government. Just me. No one else.