3 Replies Latest reply on Feb 18, 2009 12:52 PM by Adam Warski

    Revision Types

    Scott Robidoux Newbie

      Does anybody know of a reason why there would be no 'Add' (0) revision type inserted into the versions table when creating a record? The first entry in the revisions table always seems to be a 1 for revision type (edit).

      Thanks for any help you can give.

        • 1. Re: Revision Types
          Adam Warski Master

          Hello,

          maybe you don't have the hibernate.ejb.event.post-insert event listener specified in your configuration?

          --
          Adam

          • 2. Re: Revision Types
            Scott Robidoux Newbie

            Yeah, the trigger is there.

            Now that I think more about it, if a parent record is already versioned as an add, and then you add a child record in a join table in a later transaction, will that child record appear as an edit instead of an add? It seems like that may be happening because it is only the child records that seem to be not having an add version, just edit/delete. Should it be that way?

            i.e. an object of type Request has a set of child objects of type AssetTag. The Request is created first and then the admin will go in later and create one or more AssetTags to match the equipment requested. Since the request was already created and only being edited, it seems the new records for the asset tag join table are being versioned as edit revision types instead of add revision type.

            This above is the way I THINK it is working, but I may be wrong. Adam, can you confirm or deny that is how it works? I am interested to hear your thoughts on that matter. As always, thanks for all your help with this.

            • 3. Re: Revision Types
              Adam Warski Master

              What do you mean by "child" objects? :)

              If Request has a one-to-many relationship to AssetTags, and hence a field: Set, then when you add a new AssetTag, it should be created with revision type ADD, and, basing on your settings and if the relation is bi-directional, then the Request should have a revision type MOD.

              If you're using a join table to store the relation, then the audit table corresponding to the join table should contain only ADD and DEL revision types.

              Adam