3 Replies Latest reply on Jun 5, 2008 5:48 AM by adamw

    How WikiLog associated to WikiPage

    aamonten

      Hi Adam,
      I'm having some problem to discover how Envers know that WikiLog is a RevisionEntity for WikiPage. any name pattern? what if I add an Entity WikiX would it also use WikiLog?

      thanks

        • 1. Re: How WikiLog associated to WikiPage
          aamonten

          OK, i did my homework and started to check the source of Envers, at the VersionsEntitiesConfiguration I found this piece of code

          if (revisionEntityFound) {
           throw new MappingException("Only one entity may be annotated with @RevisionEntity!");
          }
          

          So it checks if it has already found a RevisionEntity annotation in one of the Entity classes, and if so it throws and Exception, so at this moment you can only have one RevisionEntity.

          Adam, are there plans to support more than one RevisionEntity, and then associate specifics Entities to one particular RevisionEntity? Do you think its a good idea to be able to do that?

          thanks


          • 2. Re: How WikiLog associated to WikiPage
            genman

            I was originally thinking that the @RevisionEntity would have to be manually persisted and there'd simply be annotations that indicated to Envers which properties to use to store the revision ID and/or revision date. Adam came up with the idea of adding a listener and always storing the one revision entity for every versioned transaction.

            On one hand, it's good that revision information is always captured. But it's not too hard to require the user to manually persist the revision entity each time.

            • 3. Re: How WikiLog associated to WikiPage
              adamw

              Hello,

              currently there's only the possibility to have at most one RevisionEntity (see also http://www.jboss.org/envers/revision_log.html). There is an issue in JIRA (http://jira.jboss.org/jira/browse/ENVERS-6) to create "revision groups". Each revision group would have its own revision entity.

              --
              Adam