Currently, what is listed in the description only works if the embeddable class has (persistent) declared values.
As a workaround, when an embeddable class with no declared data extends a mapped superclass, auditing can only be enabled for the mapped superclass data by annotating the embeddable class with @Audited. For example,
@MappedSuperclass
public class AbstractB {
}
@Embeddable
@Audited public class B extends AbstractB {
}
@Entity
@Audited
public class A{
...
private B b;
...
}
Unfortunately, this will affect all audited entities that contain an embedded instance of that class. Currently, @AuditOverride cannot be used on an embedded field to disable auditing the mapped superclass (HHH-9228). The only way to override auditing for a particular embedded field is to annotate the embedded field with @NotAudited.
@Entity
@Audited
public class OtherA{
...
@NotAudited
private B b;
...
}
In addition, @AuditOverride( ... isAudited=false) does not for embeddables that extend a mapped-superclass.
|