> So the basic rule is: > - fields from a non-audited mapped superclass are never audited, unless an > @AuditOverride is specified > - if the mapped superclass is audited, then its fields are of course audited > as well > > > In the following, A.b.intValue should be audited; A.b.strValue should not > > be audited. > > > > {code} @Entity > > @Audited > > public class A{ > > ... > > private B b; > > ... > > } > > > > @Embeddable > > public class B extends AbstractB { > > private int intValue; > > } > > > > @MappedSuperclass > > public class AbstractB { > > private String strValue; > > } {code} > > Looks good > > > In the following, both A.b.intValue and A.b.strValue should be audited: > > > > {code} @Entity > > @Audited > > public class A{ > > ... > > private B b; > > ... > > } > > > > @Embeddable > > public class B extends AbstractB { > > private int intValue; > > } > > > > @MappedSuperclass > > @Audited > > public class AbstractB { > > private String strValue; > > } {code} > > Yes > > > In the following, both A.b.intValue and A.b.strValue should be audited. > > > > {code} @Entity > > @Audited > > public class A{ > > ... > > private B b; > > ... > > } > > > > @Embeddable > > @AuditOverride( class=AbstractB.class ) > > public class B extends AbstractB { > > private int intValue; > > } > > > > @MappedSuperclass > > public class AbstractB { > > private String strValue; > > } {code} > > Yes > > > What should be the outcome of the following? Should A.b.strValue still be > > audited even though A.b is explicitly not audited? > > > > {code} @Entity > > @Audited > > public class A{ > > ... > > @NotAudited > > private B b; > > ... > > } > > > > @Embeddable > > public class B extends AbstractB { > > private int intValue; > > } > > > > @MappedSuperclass > > @Audited > > public class AbstractB { > > private String strValue; > > } {code} > > @NotAudited has precedence - so not audited.
...
> Adam Warski
|