JBoss Community

Re: Entity hashCode and equals overriding

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

If I invoke one time addArticle() method then the cart is not empty but cart.getArticles().get(book) always return null even if the cart contains some entries. When I got this situation i figured out that the problem was the lack of hashCode and equals. Now that the methods are implemented nothing is changed. Moreover i've tried using a hashCode() that return always 1 and equals() that return always true but currentQuantity is still null.

 


Reply to this message by going to Community

Start a new discussion in EJB3 Development at Community