3 Replies Latest reply on Jul 24, 2009 5:14 PM by adamw

    valid_from  /  valid_to   possible?

    bestage

      Is it possible to query the history for entities which were valid on XX.XX.XXXX ???? something like when I used valid_from / valid_to.

        • 1. Re: valid_from  /  valid_to   possible?
          adamw

          Hello,

          you just need to obtain the revision number for that date (there's a method for that in AuditReader), and then you can read/query entities at that revision.

          Adam

          • 2. Re: valid_from  /  valid_to   possible?
            bestage

             

            "adamw" wrote:
            Hello,

            you just need to obtain the revision number for that date (there's a method for that in AuditReader), and then you can read/query entities at that revision.

            Adam


            Adam,

            Now I understand. I have also found an interesting discussion here:

            http://www.jboss.org/index.html?module=bb&op=viewtopic&t=142958

            In fact, you are right, this approach works well if I need to find the Entity on date X, which is very often a business requirement.



            One more question: have you ever thought of making a Locking Component too?

            This pattern "lock-modify-unlock" (also described in the SVN docs) is a must for a typical business online app, where the users that first started an edit locks the record, so that all the other users can only view such a record.




            • 3. Re: valid_from  /  valid_to   possible?
              adamw

              Hello,

              I guess locking doesn't fall really in the scope of auditing - that would be a separate project :)

              Adam