[jboss-user] [EJB 3.0] - Re: Not understanding detached entities and merge()

mazz@jboss.com do-not-reply at jboss.com
Thu Feb 15 00:11:15 EST 2007


You do as you originally said - that is, use find() to load in the entity and fill in that attached entity with the data coming in from that detached pojo.

There isn't much you can do because the detached pojo you are getting is half-full (i.e. missing that transient data).  It has some data but not all of it; but the JPA container doesn't know what is "right" and what is "wrong" with respect to the contents of your detached pojo (since a null collection is clearly a valid thing to have - the container doesn't know if that's what you really want or not).  The merge(), therefore, is going to assume the detached pojo getting merged is "full" - that is, it has the correct state for the entire entity.




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

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



More information about the jboss-user mailing list