Envers tries to use relationship's entity as value for column instead of numeric identifier (cast class exception happens) for LAZY @ManyToOne

Description

I have an entity mapped as:

ID of Address.Version is composite of Address entity + a numeric version number (not related to `@javax.persistence.Version`).
ID of Address is numeric ID.
ID of Shipment numeric ID.

and when an update transaction is about to commit, I get:

I cannot be 100% sure but I think this started to happen when we moved to both origin and destination addresses being `optional=true`

Environment

JDK 11, Mac OS X

Assignee

Chris Cranford

Reporter

Francisco Alejandro Lozano López

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure