The values of the “_MOD” fields are incorrect in specific cases.
The problem happens when you try in the same transaction, to modify in this example, the “PersonEntity" entity (by modifying the name), and add an entity to multiple OneToMany relations (in the above example, if you add an entity into services and an entity into optIns), the flag of the modified fields in the entity will be correct, but only the flag of the first collection modified will be set. For example:
- Modify the name
- Add a PersonneServiceEntity to the services relation
- Add a OptinEntity to the optIns relation
When you check the values in the database, you will see that all the flag will be correctly set except the OPT_INS_MOD flag. If you add a OptinEntity before the PersonneServiceEntity, then the OPT_INS_MOD flag will be set correctly but not the SERVICES_MOD flag. If you don’t modify the name, then the flag of all collections will be set correctly. (This is the same problem as https://stackoverflow.com/questions/64011351/hibernate-envers-wrong-modified-flag-on-list ) |