-
1. Re: RelationTargetAuditMode.NOT_AUDITED to Audited entity
adamw Sep 3, 2012 3:32 PM (in response to peter.eigenschink)RelationTargetAuditMode.NOT_AUDITED works only if A isn't audited - it sounds as it is.
If A is audited you need to look it up yourself using the entity manager.
Adam
-
2. Re: RelationTargetAuditMode.NOT_AUDITED to Audited entity
peter.eigenschink Sep 5, 2012 5:27 AM (in response to adamw)Maybe it's just my opinion, but shouldn't the explicit specification of RelationTargetAuditMode.NOT_AUDITED overrule the specification of A as audited from B's point of view?
Sure you are right, that it sounds as it is, but I think, as nobody would mark a relationship which should be audited with this annotation, it would be nice if it was possible to specify a relationship to an audited entity as RelationTargetAuditMode.NOT_AUDITED to point to the most recent version of this entity.
Peter
-
3. Re: RelationTargetAuditMode.NOT_AUDITED to Audited entity
adamw Sep 9, 2012 1:43 PM (in response to peter.eigenschink)Hmm well I think that in fact in such a case an exception should be thrown. Wanting to get the latest version of an entity on an audited relation seems like a very rare use-case.
Adam
-
4. Re: RelationTargetAuditMode.NOT_AUDITED to Audited entity
stigrv Apr 11, 2013 9:25 AM (in response to adamw)I have to agree with Peter here. There are some rare cases where you actually need this annotation to work in this way. I ran into the same issue myself now, and has been scratching my head for a few hours trying to figure out what I did wrong.
I also checked the envers source code to see where this annotation is read. The only place it is read, as far as I can see, is to avoid an error message if you link to an un-audited entity. It might therefore be a bit more involved in solving this problem.