I'm trying to use envers in my application, but I stumbled upon some subtleties.
I want to know if this should be the correct behaviour.
I have these classes: Person && Contact
Person (id, name, List<Contact>)
Contact(contact, value)
When I create a person record with 3 contacts, both records in Person and Person_aud tables ares created. Person has revision number = 1;
Then I delete two contacts: Person revision is increased to 2, and the two contacts are removed.
Then I associate 4 contacts: And again person revision is increased to 3, and contacts are added.
My question is, when I try to get person revision = 1, A person with 3 contacts should be returned. When trying to get revision 2, person with only one contact should be returned, and finally, when getting revision 3 , a person with 4 contacts should be returned . Am I right??
However I get revision 2 (contacts were removed), it gives me all the contacts already associated (The first 2, and the last 4) Is this supposed to?