The problem is that your EmbeddedBean does not define an equals method. If we avoid the ValidityAuditStrategy for a moment and look at the DefaultAuditStrategy its clear the behavior is incorrect when no equals method is defined. The table for the list ends up with rows like the following:
Value |
Rev |
RevType |
Ordinal |
2 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
2 |
2 |
0 |
1 |
1 |
2 |
0 |
0 |
3 |
2 |
0 |
2 |
2 |
2 |
2 |
1 |
1 |
2 |
2 |
0 |
Based on the java code what should be observed is:
Value |
Rev |
RevType |
Ordinal |
2 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
3 |
2 |
0 |
2 |
The ValidityAuditStrategy ends up very similar with the same number of rows without the defined equals method but with the intermingled update statements to keep the REVEND and REVEND_TSTMP fields synchronized with the revision validity tracking logic. |