5 Replies Latest reply on May 4, 2010 6:53 AM by Adam Warski

    How to get all revisions of an entity if only associated entity has changed?

    Stefan Haberl Newbie

      Hi,

       

      I'm currently evaluating Envers for a large scale project. I was following roughly the quickstart example from the doc with the Person and Address entities and did the following

       

      • Created a person1 => revision 1
      • Created a person2 => revision 2
      • Changed the address of person1 => revision 3
      • Changed the address of person1 again => revision 4

       

      Where I'm stuck: How do I get a list of all the revisions where person1 has changed (i.e., [1, 3, 4])?

       

      I do not want to query the revisions of the address, which might be feasible and simple in this easy domain model. Our domain model will be rather big, with dozens of entities on the person (including transitive entities as well). You could query all of them independently by walking the object tree of the person manually, but it would be rather nice if Envers would already do that for me.