Consider two entities Parent and Child.
- Child is part of Parent's transient collection
- Child has a ManyToOne mapping to parent with FetchType.LAZY
Both are displayed on the same form to a user. When user saves the data we first update Parent instance and then Child collection (both using merge).
Now comes the tricky part. When user modifies only Child property on the form then hibernate dirty checking does not update Parent instance and thus does not increase optimistic locking version number for that entity.
I would like to see situation where only Parent is versioned and every time I call merge for Parent then version is always updated even if actual update is not executed in db.