Tomáš Müller (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5b50823...
) *commented* on HHH-16825 (
https://hibernate.atlassian.net/browse/HHH-16825?atlOrigin=eyJpIjoiNGFmZD...
)
Re: Cascading an entity with a composite key causes NullPointerException in
AbstractClassJavaType.extractHashCode (
https://hibernate.atlassian.net/browse/HHH-16825?atlOrigin=eyJpIjoiNGFmZD...
)
Hi Andrea,
Thank you for looking into this!
The original (Hibernate 4.3.11) code is using hbm.xml model instead of annotations. Also,
we used to use Session’s update, save, and saveOrUpdate methods, which are now deprecated,
so these were changed to persist and merge.
Model.hbm.xml (
https://hibernate.atlassian.net/rest/api/3/attachment/content/50512 )
hibernate.xml (
https://hibernate.atlassian.net/rest/api/3/attachment/content/50508 )
Top (25bf5227-c146-4c15-90be-cf725ba44d6b).java (
https://hibernate.atlassian.net/rest/api/3/attachment/content/50509 )
Middle (0220a311-57fe-404b-a224-727a837f03b8).java (
https://hibernate.atlassian.net/rest/api/3/attachment/content/50510 )
HashTest (7df9f90c-894e-4c32-bb0f-050269d1d434).java (
https://hibernate.atlassian.net/rest/api/3/attachment/content/50513 )
Bottom (f047f675-00dd-45d6-b976-b000034217b2).java (
https://hibernate.atlassian.net/rest/api/3/attachment/content/50511 )
I have modified the test to mimic our original code. See the attached files. It does not
fail using Hibernate 4.3.11.
If I change the test to use merge instead of update, it fails with the
NullPointerException (in the AbstractTypeDescriptor.extractHashCode). So, the problem
seems to be related to using merge instead of update instead of the upgrade per se. But
still, I do not really understand why there is a difference.
(
https://hibernate.atlassian.net/browse/HHH-16825#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16825#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#100232- sha1:1e691fe )