3 Replies Latest reply on Jan 25, 2010 10:34 AM by adamw

    Creating custom RevisionInfoGenerator

      I'd like to use my own revision entity, and set some extra fields other than timestamp in there, which it seems would be done in my own implementation of RevisionInfoGenerator. But it doesn't seem possible to change the DefaultRevisionInfoGenerator created in RevisionInfoConfiguration. Is there a way to do this?

       

      Thanks,

        • 1. Re: Creating custom RevisionInfoGenerator
          adamw

          Hello,

           

          I think what you want is a custom revision entity. Did you read about it in the documentation?

           

          Adam

          • 2. Re: Creating custom RevisionInfoGenerator

            Hi,

             

            Yes, I am using my own custom Revision entity, but what I'd really like to do is change how the saveRevisionData in DefaultRevisionInforGenerator is implemented, as I want to set a bunch of other information on a revision (such as the current user etc...). As there is an interface for RevisionInfoGenerator, I was hoping it was possible to change the generator used, but it doesn't seem possible to use anything other than the DefaultRevisionInfoGenerator (yet?)

             

            Thanks,

            Adam

            • 3. Re: Creating custom RevisionInfoGenerator
              adamw

              Hello,

               

              you're right, swapping the RevisionInfoGenerator isn't possible (well, unless you change the code and re-compile Envers ), but why can't you have the user field in the revision entity and set the field for example in a revision listener?

               

              Adam