posted 14 years ago
Hi,
If i would like to update the data using entitymanager.merge, do i need to first find the object by using em.find(xxx.class,id) and set the modified data to the retrieved object and then call em.merge(POJO).
eg.
Employee employee = em.find(Employee.class,"E1001");
employee.setName("asdf");
employee.setSalary("2323");
em.merge(employee);
OR
what if i pass the updated POJO and without using em.find, if i directly use em.merge(POJO), will it be a problem?
eg.
em.merge(employee);
Pls suggest which patten should i follow.