7 Replies Latest reply on Jul 15, 2009 2:15 AM by adamw

    Turn off versioning

    kaizersh

      Hi,

      Is it possible for me to use Envers just for pure auditing and not for versioning? My audit tables wouldnt contain columns for revision number and type, and i dont need a REVINFO table either.

      Thanks.

        • 1. Re: Turn off versioning
          adamw

          No, that's not possible currently.

          Adam

          • 2. Re: Turn off versioning
            kaizersh

            Hi,

            Could you please give me some pointers on how to achieve this? Which pieces of code in Envers would i need to touch?

            Thanks.

            Regards
            Kaizer

            • 3. Re: Turn off versioning
              adamw

              So what would you like to store in the audit tables? Just the data? Don't you also need to store a timestamp (which is stored in the REVINFO table)?

              Adam

              • 4. Re: Turn off versioning
                kaizersh

                Hi,

                Yes we would like to store just the data. There will be a column where we will store the operation type (Insert/Update/Delete). We store fields like created by, created date, etc in the main table and so the same data would get stored in the audit table as well. We just dont need the versioning feature.

                Thanks,

                Regards
                Kaizer

                • 5. Re: Turn off versioning
                  adamw

                  Ah. Well, then you would have to remove from the Envers code the places where the revision entity is persisted and the field from the audit tables. This would be a small modification of the code.

                  Adam

                  • 6. Re: Turn off versioning
                    kaizersh

                    I think it'd be a nice feature to have in Envers itself. But in the meanwhile, could you please tell me some of the classes I need to look at so that making the changes will be faster for me. :)

                    Thanks,

                    Regards
                    Kaizer

                    • 7. Re: Turn off versioning
                      adamw

                      So, in AbstractAuditWorkUnit.fillDataWithId you'll need to remove the line where the revision number is added. Then, in AuditSync.getCurrentRevisionData you'll need to remove the revision entity generation. Finally, in AuditMetadataGenerator you should remove the lines in addRevisionInfoRelation where the relation to the rev info table is added.

                      Adam