pHi,
I have the following associations created:
@Entity
@Audited
public class SomeClass {
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "joincolumn")
private AnotherClass clazz;
}
@Entity
@Audited
public class AnotherClass {
private String name;
...
}
If I do:
someClass.getClazz().setName("a new name");
This causes a new revision of AnotherClass, but no new revision of the SomeClass entity. I would expect Envers to create a new revision of the "owner" and the "owned" relationships, as otherwise it will force me to implement the AnotherClass class fields as part of the SomeClass fields in order to get new revisions on its attributes changes.
Modifying the
org.hibernate.envers.revision_on_collection_change |
property doesn't seem to help.
Any ideas if this is possible or am I doing something wrong here?
Well you only modify the child entity so the parent is not modified - no revision. Why would you want to create a new revision for the parent?
Adam