@MapKey with Envers causes “PropertyAccessException: Error accessing field”

Description

Using the following entities:

Note the referencedColumnName in @JoinColumn - that’s what seems to be causing the error. Using a regular @JoinColumn that references the Item#id instead of Item#guid seems to work fine.

But with the above mapping, adding new CustomFields to an Item and saving it, causes this error:

A reproducible example can be found here:

However, it doesn't seem to happen 100% of the time (it does pretty often, though) - the error occurs on line 172 here, but is sometimes prevented by the `==` check on line 168

I have tried on `5.4.0.Final` and `5.4.21.Final`

Environment

None

Assignee

Chris Cranford

Reporter

Andrey Ustalakov

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure