{code:java} @Audited @Entity public class Entity { @Id private long id; private String value; @OrderColumn @ElementCollection private List<Embeddable> embeddables; ... // omit getter and setter ... }
Entity entity = new Entity(); entity.setId(1); entity.setValue("a"); em.persist(entity); {code} This will create this audit record:
||id||REV||REVTYPE||REVEND||REVEND_TSTMP||value||value_MOD||embeddables_MOD |1|1|0|NULL|NULL|a|1|1|
However, if we update the entity after persist it. for example: {code:java} Entity entity = new Entity(); entity.setId(1); entity.setValue("a"); em.persist(entity); entity.setValue("b"); {code} this will create this audit record: ||id||REV||REVTYPE||REVEND||REVEND_TSTMP||value||value_MOD||embeddables_MOD |1|1|0|NULL|NULL| a b |1|0|
The value of column 'embeddables_MOD' changed from 1 to 0, though embeddables is not updated at all.
|
|