Issues
- Cannot invoke "org.hibernate.envers.internal.entities.EntityConfiguration.getRelationDescription(String)" because "entCfg" is nullHHH-17652Resolved issue: HHH-17652Marco Belladelli
- Wildcard escape does not work anymoreHHH-17608Resolved issue: HHH-17608
- Cannot resolve path of nested generic mapped-superclass joinsHHH-17606Resolved issue: HHH-17606Marco Belladelli
- Criteria multiselect doesn't work properly for array types other than Object[]HHH-17598Resolved issue: HHH-17598Marco Belladelli
- deprecated lazyLoading no longer workingHHH-17326Resolved issue: HHH-17326Andrea Boriero
5 of 5
Cannot invoke "org.hibernate.envers.internal.entities.EntityConfiguration.getRelationDescription(String)" because "entCfg" is null
Fixed
Description
Details
Assignee
Marco BelladelliMarco BelladelliReporter
Ádám KovácsÁdám KovácsLabels
Worked in
Components
Fix versions
Affects versions
Priority
Major
Details
Details
Assignee
Marco Belladelli
Marco BelladelliReporter
Ádám Kovács
Ádám KovácsLabels
Worked in
Components
Fix versions
Affects versions
Priority
Created January 18, 2024 at 1:48 PM
Updated February 13, 2025 at 10:17 AM
Resolved January 7, 2025 at 3:56 PM
Activity
Ádám KovácsJanuary 18, 2024 at 3:32 PMEdited
I’ve submitted a PR with the missing if condition
I'm migrating from Hibernate Envers 5.x to 6. In my project there are a few entities with many-to-many relationships, the junction tables are represented with entities, having a few additional fields. In these entities both sides of the relationship are
@ManyToOne
fields.I have a custom RevisionListener which checks for the last two revisions of the modified entity and creates a diff from it. In this listener the
AuditReader#find
method throws a NullPointerException:There is a change in the
ToOneIdMapper
class since hibernate 6.0 that might be causing the issue:In 5.x there used to be a check for whether the referenced entity is audited, and since it is, it was skipped in 5.x:
if ( !referencedEntity.isAudited())
Now it tries to get the
referencingEntityName
, but since themap
contains no$type$
, it is null and later in theEntitiesConfigurations#getRelationDescription
it causes a NPE, because neither of the paths provide an EntityConfiguration here:So it throws a NPE here: https://github.com/hibernate/hibernate-orm/blob/6.2/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/EntitiesConfigurations.java#L101
I haven't found anything about it in the migration docs, am i missing something?
I've created a repo for showcasing my issue:
Any help would be greatly appreciated.