merge() will figure out whether or not the entity passed is new or detached. If 
it's new then merge() will persist it (eventually resulting in an INSERT), 
otherwise it will update the DB with the current state of the entity 
(eventually resulting in an UPDATE).

(warning: merging a removed entity will throw an exception)

check these out for more info:

http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/objectstate.html
section 3.6 and 3.7

EJB3 Persistence Specification section 3.2.4.1

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046337
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to