We're updating the issue view to help you get more done. 

NullPointerException when reading an audited entity that has a collection of embeddables with a ManyToOne to an unaudited entity.

Description

When using an audited entity collection of an embeddable:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 @Audited public class Parent { // ... @ElementCollection @CollectionTable(name = "items", joinColumns = @JoinColumn(name = "PRODUCT_ID")) @OrderColumn(name = "ORDER_COL") @Audited private List<Item> items = new ArrayList<Item>(); } @Embeddable @Audited public class Item { // ... @ManyToOne @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) private Type type; }

This causes a NullPointerException to occur when fetching a revision of the Parent entity when the embeddable Item contains a non-null reference to Type, which is not audited. This is only an issue when the embeddable class holds a reference to a non-audited entity.

Environment

None

Status

Assignee

Chris Cranford

Reporter

Dmitriy Sulimchuk

Components

Fix versions

Affects versions

5.2.4

Priority

Critical