Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-15469 (
https://hibernate.atlassian.net/browse/HHH-15469?atlOrigin=eyJpIjoiOTc4Mz...
)
Re: Missing EntityNotFoundException while using @ManyToOne / @OneToMany and EntityManager
interface (
https://hibernate.atlassian.net/browse/HHH-15469?atlOrigin=eyJpIjoiOTc4Mz...
)
It is disastrous that in one case an exception is thrown and in the other
case not, even though it is the same semantics.
This is simply a bad quality of the software. It is your decision to
reopen the bug and thus improve the quality of the software.
These statements are absurd.
This question is: what to do with an object that has been explicitly marked for removal,
and is thus in the transient state, but has not been dereferenced by an association which
is mapped CascadeType.PERSIST.
This is an admitted corner case, where the “correct” behavior is at least a bit unclear.
However, the simplest and most consistent interpretation is that, since
{{CascadeType.PERSIST}}means: move a referenced transient instance to the persistent
state, the instance should be made (again) persistent at flush-time.
And so that’s what Hibernate does when operating in JPA-compliant mode.
This is completely fine, as far as I’m concerned.
What we could consider doing is aligning the behavior in native bootstrap mode with the
behavior just described, and I think there’s a somewhat good argument for doing that. (But
that’s the exact opposite of what you’re asking for.)
(
https://hibernate.atlassian.net/browse/HHH-15469#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15469#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100234- sha1:9e2db29 )