As you sead merge is used for detached objects and persist for atached ones.
Short example for persist (update action)
EntityManger em;
.....
Tab02000 recentRecord = (Tab02000)em.find(Tab02000.class, key);
.. do some changes to recentRecord
em.persist(recentRecord); // in this case JPA will call update action because you are
changing existing object
Short example for merge
EntityManger em;
Tab02000 newRecord = new Tab02000();
... set all values
em.merge(newRecord);
The second example is BAD PRACTISE of using JPA
Jan
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046303#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...