1 Reply Latest reply on Apr 15, 2011 5:53 AM by Adam Warski

    Relations and queries

    Matthias - Newbie



      I'm new to hibernate and just found envers. This documentation http://docs.jboss.org/hibernate/envers/3.6/reference/en-US/html/queries.html seems to say that I can't query relationships (yet).


      Regarding this I have a few questions:


      1) If querying with relations worked, does this allow me to view/query the database as it was at a given revision? E.g. can I do something like query all wheels of car with id=123 at revision=456 (returns the wheels at revision 456 or earlier)?

      I am asking this, because in ZODB (python object database) you can just put a date/revision into the database session/connection and then you can read the whole database as it was at the given revision. So I'm wondering if Envers can do the same when queries with relations are supported.


      2)  How hard is it to add support for historical relation queries to envers? Is there any rough estimate yet?


      Thanks for looking into this,


        • 1. Relations and queries
          Adam Warski Master



          1) currently you can only create queries on properties of a single entity, so you can say that you want to get the Wheel entity where the revision is 456 and the wheel.car_id=123. You *cannot* refer to car properties, e.g. say that you want wheel.car.color="red".


          But yet, if relations worked normally, then you would be able to view the database as it existed at a given revision.


          2) No estimates . It is only possible for the validity audit strategy.