I'm trying to add envers auditing to a model which has some @Embedded elements. Those elements themselves are not audited.
On a regular relation field to achieve this, you would write @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
.
However, this seems not to work on the @Embedded entry. At runtime, I still get error: Caused by: org.hibernate.MappingException: An audited relation from XX to a not audited entity Building! Such mapping is possible, but has to be explicitly defined using @Audited(targetAuditMode = NOT_AUDITED).
@Embedded
@AttributeOverrides({
@AttributeOverride(name = "building"),
@AttributeOverride(name = "division"))
})
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) // doesn't work
private BuildingInfo buildingInfo;