3 Replies Latest reply on Jun 30, 2010 9:20 AM by Hernán Chanfreau

    _revisions_info table

    Amin Mohammed-Coleman Newbie

      Hi there

      Is there any particular reason for having a seperate table for holding a pk and the timestamp? Is it not ok to store the timestamp next to entry in the version table?


      Thanks

        • 1. Re: _revisions_info table
          Adam Warski Master

          Hello,

          this would be ok it there was only one versions entity. If you have more then one, for example in a many-to-one relation, you need something that binds them. And there may be two revisions at the same timestamps (unlikely, but possible).

          The _revision_info table makes additional sense if you're storing additional information associated with each revision, like the name of the user that made the change, using @RevisionEntity (see http://www.jboss.org/envers/revision_log.html).

          Adam

          • 2. Re: _revisions_info table
            Syed Mahdi Apprentice

            Im working on this version as well i have _revision_info table,

             

            I made a simple pojo

             

             

             

            @RevisionEntity
            public class LSRevisionEntity extends DefaultRevisionEntity {
            private String username;
            private String screenName;
            public String getScreenName() {
            return screenName;
            }
            public void setScreenName(String screenName) {
            this.screenName = screenName;
            }
            public String getUsername() { return username; }
            public void setUsername(String username) { this.username = username; }
            }

             

            but the table is still made with only the default revision_id and Revison_timestamp. the new tables fro username and screenname is not made. I was expecting two more columns i think. Is it not avaialble in version 1.0.0 or do i need to make a hbm.xml file for it ... the _revision tables get generated without anything.

             

            Am I missing out something here?

             

            thanks.

            Syed

            • 3. Re: _revisions_info table
              Hernán Chanfreau Master

              Hello!

               

              Did you add your LSRevisionEntity as a persistent entity for hibernate? I think you must put @Entity or make a xml mapping file.

               

              Hope it will help.

               

              Regards, Hernán.