JBoss Community

Re: Entity hashCode and equals overriding

created by Piotr Nowicki in EJB3 Development - View the full discussion

If you invoke addArticle(-) for the first time - the cart.getArtiles() is empty.

 

If you invoke addArticle(-) again - the cart.getArticles().get(book) will return null, but will the cart.getArticles() be empty? Try debugging it - is the previous article in the map (then you have a problem with hashCode and/or equals) or it's not there (and you have a problem with persistence).

Reply to this message by going to Community

Start a new discussion in EJB3 Development at Community