Open iammatis opened 5 years ago
Refreshed entity is not acting as a "pointer", entity objects keeps same attributes, doesn't get refreshed.
Student student = new Student("student 1");
entityManager.getTransaction().begin();
entityManager.persist(student);
entityManager.getTransaction().commit();
student.setName("changed name");
entityManager.refresh(student);
// At this points student object still has "changed name" as name attritbute
// -> refresh didn't work
https://www.logicbig.com/tutorials/java-ee-tutorial/jpa/refreshing.html