I'm using Hibernate to map the tables of our database and some of them are audited with Envers (@Audited on the entity class). To solve the same problem that is described in DATAJPA-885, I switched to the latest snapshot (1.11.0).
I'm now getting a NullPointerException at the start of the application on the table_AUD classes generated by Hibernate. The NPE is because the javaType of the _AUD EmbeddableTypeImpl object is null.
I'd argue it is. ManagedType.getJavaType() is supposed to never return null. I am not sure how this would make any sense at all. I think we can still guard against that but I strongly suggest to file a ticket against Hibernate
Even though I got past this issue for the migration by researching on google, I do not understand the issue and its solution completely. Can you please explain to me in layman's terms what the issue is and how the version upgrades solves the issue ? Any time or explanation you can provide me will be greatly appreciated. Thank you for your time.
From the Spring Data view of things: Hibernate broke a contract of an API JPA by returning {{null}. They felt that would be OK since it is used for things outside the scope of JPA.
Oliver argued, that if one provides an instance implementing an interface from some specification, that instance should behave like described in that specification. People from Hibernate seemed to disagree.
Anyway, the issue on the Hibernate side got fixed, so I assume the method in question doesn't return null anymore. Also Oliver added null} checks, so even if it does return {{null no NPE is thrown
Daniel Durette opened DATAJPA-904 and commented
Hi,
I'm using Hibernate to map the tables of our database and some of them are audited with Envers (
@Audited
on the entity class). To solve the same problem that is described in DATAJPA-885, I switched to the latest snapshot (1.11.0).I'm now getting a NullPointerException at the start of the application on the table_AUD classes generated by Hibernate. The NPE is because the javaType of the _AUD EmbeddableTypeImpl object is null.
How do I solve this problem? Is this a problem in Hibernate?
Affects: 1.9.4 (Gosling SR4), 1.10.1 (Hopper SR1)
Issue Links:
Backported to: 1.10.2 (Hopper SR2), 1.9.5 (Gosling SR5)
The text was updated successfully, but these errors were encountered: