I have a hibernation object called Execution. It is created at the beginning of my process and updated at the end, indicating how it ended.
I would like to update one property of this object without causing a selection in my database.
Execution execution = entityManager.getReference(Execution.class, executionId);
execution.setStatus(Status.FINISHED);// -> Calling this method calls SELECT in my database. I did not want this to happen, I just want to update my essence.
This does not apply to this method, any other method called results in the SELECT clause. In fact, a choice appears, happens even before my method is called. My impression is that hibernate proxies put some code inside my no-args contructor class to run the selection every time any method is called.
Is it possible to update JPA / Hibernate objects without running SELECT statements in my database?
source
share