JBoss Community

Re: Entity hashCode and equals overriding

created by fabio valsecchi in EJB3 Development - View the full discussion

I tried to use equals() returning true and hashCode returning 1 only for testing. Because in this way if all books has the same hashcode it would like "all the books are the same". But since even in this case the call returns null i've tried with normal equals() and hashCode() to print the hashCode of the book inserted in the cart and the hashCode of the book inserted. They were equals.

However i can retry to investigate deeply.

 

Thank u Piotr!

Reply to this message by going to Community

Start a new discussion in EJB3 Development at Community