The user has n contacts. A contact may have a localized comment (comments are shared between contacts). Java Beans:
@Audited @Entity public class User { @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true) Set<Context> contacts; } @Audited @Entity public class Contact { @ManyToOne(fetch = FetchType.EAGER, cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) Comment comment; } @Audited @Entity public class Comment { String de; String en; String fr; }
If I changed the German localization (Comment.de) of the contact (Contact.comment), then this will create a new revision, but not for the user. If I ask envers for User Revisions, I will never see this “level 2 change”, because the connection between the user and the contact has not changed, only the German line in the comment for the contact has been changed.
But I want to see a new entry in the User History (Changed German comment for XYZ contact).
How can I do this ?: D
thanks
source share