Reputation: 1593
I'm trying to come up with an audited entity by means of Hibernate envers feature. I have a base class: Result
@Entity
@Table(name = "result")
public class Result {
@EmbeddedId
@AttributeOverride(name = "value", column = @Column(name = "id"))
private ResultId id;
@Audited
@Column
private String value;
@Audited
@AttributeOverride(name = "value", column = @Column(name = "updated_by"))
private PersonId updatedBy;
}
In application I make changes for the entity value and updated_by fields. But in audit table I see only changes for value property, but updated_by always has NULL. It seems to me that @Audited
and @AttributeOverride
is not compatible.
How can I achieve auditing for updated_by field?
Upvotes: 0
Views: 999
Reputation: 2152
You need to use @AuditOverride
rather than the @Audited
, as you are overriding the default audit behaviour of the field.
Upvotes: 1