Page 1 of 1

About Question enthuware.oce-jpad.v6.2.420 :

Posted: Sat Aug 29, 2015 1:32 pm
by NightCapybara
There are two completely identical answers.
X
Y
Y

X

X
Y

X
Y

Re: About Question enthuware.oce-jpad.v6.2.420 :

Posted: Sat Aug 29, 2015 9:00 pm
by admin
No, I see that the third option is YY.

Re: About Question enthuware.oce-jpad.v6.2.420 :

Posted: Sun Jun 25, 2017 6:02 pm
by himaiMinh
Hi, everyone,
According to the spec section 3.5.2:
For entities to which the merge operation has been applied and causes the creation of newly managed instances, the
PrePersist callback methods will be invoked for the managed instance after the entity state has
been copied to it.
I think when the merge is called in this case, the PrePersist should be called according to the spec.
Any comments?

Re: About Question enthuware.oce-jpad.v6.2.420 :

Posted: Tue Jun 27, 2017 10:05 pm
by admin
From what you have quoted, "For entities to which the merge operation has been applied and causes the creation of newly managed instances,..."
In this question, the merge operation does not cause the creation of a new entity. So why do you expect PrePersist to be called?
Paul.

Re: About Question enthuware.oce-jpad.v6.2.420 :

Posted: Mon Jul 03, 2017 1:18 pm
by himaiMinh
I tried with Eclipselink. If X is a new entity that does not exist in the database, a entityManager.merge (x); statement will create and persist that entity. Then, the Pre/post Persist is called.

But that may be only happening in Eclipselink.