[jboss-user] [JBoss Seam] - Re: Problem with s:convertEntity

petemuir do-not-reply at jboss.com
Sun May 6 03:53:31 EDT 2007


I'm sure Christian can explain this better than me but my (poor) understanding is that:

* If you get a persistent object twice from the same EntityManager, then it takes care of returning the same object. Thus, the default equals and hashcode work.  

* Equals and hashcode are *hard* to get right when using persistence (you need to use a natural id - not the pk) if you want Collections to work with detached objects.

Therefore, as Seam's LRCs mean you (rarely) need to work with detached objects, you neatly avoid the equals/hashcode problem.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043503#4043503

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043503



More information about the jboss-user mailing list