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/objects...
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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...