Unable to populate an ElementCollection (of an embeddable type) of an audited entity when the collection has a null value for a property with JoinColumn

Description

When there is a parent entity that has a List of an Embeddable object, and that Embeddable object defines a @JoinColumn, AuditReader fails to populate the List with the values if the property with the JoinColumn has not been set (is null). Test case to follow.

Test case:
https://github.com/cklab/hibernate-test-case-templates/tree/hhh11364/envers/envers-5

Environment

MySQL 5.6.24
Hibernate 5.2.6

Activity

Show:
CK Lab
December 30, 2016, 12:34 AM

Looks like it's related to https://hibernate.atlassian.net/browse/HHH-8968. If the JoinColumn is not defined, we are doing a null = null check and not an IS NULL.

Chris Cranford
January 5, 2017, 9:32 PM

, I updated the PR with some requested changes I'd like to see made.

CK Lab
January 6, 2017, 12:24 AM
Edited

@Chris Rebased and implemented your suggestions.

Gail Badner
January 10, 2018, 6:17 AM

Fixed in 5.1 branch as well.

Assignee

Chris Cranford

Reporter

CK Lab

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure