Entities equals(), hashCode() and toString(). How to correctly implement them?
- by spike07
I'm implementing equals(), hashCode() and toString() of my entities using all the available fields in the bean.
I'm getting some Lazy init Exception on the frontend when I try to compare the equality or when I print the obj state. That's because some list in the entity can be lazy initialized.
I'm wondering what's the correct way to for implementing equals() and toString() on an entity object.