3 ms·
People normally do that when they do not have to do that. Dog rex = em.find(Dog.class,"rex"); // 1 rex.setAge(2); // 2 // other query // 3 At 3 the upda
by alserio 6y ago
People normally do that when they do not have to do that.
Dog rex = em.find(Dog.class,"rex"); // 1
rex.setAge(2); // 2
// other query // 3
At 3 the update is flushed on the underlying db.
This is pure JPA. Calling merge is forcing an useless query before the update. Also, merge returns the managed entity.