6 Replies Latest reply on Feb 1, 2010 11:59 AM by andystone

    Problem auditing joined inheritance.

    andystone

      I have just started using this product, and am getting the following exception:

       

      Field 'REV' doesn't have a default value

       

      when persisting an audited entity.

       

      The entity being persisted consists of two tables related via a joined inheritance relationship.

       

      Both entities are marked as 'Audited'.

       

      Has anyone any idea what is going on.

       

      Thanks in advance,

       

      Andy.

        • 1. Re: Problem auditing joined inheritance.
          adamw

          Hello,

           

          did you generate the audit schema by hand or using the envers hbm2ddl task?

          The problem is probably a superflous "rev" column in the table corresponding to the sub-class (as the revision is already specified in the superclass).

           

          Adam

          1 of 1 people found this helpful
          • 2. Re: Problem auditing joined inheritance.
            andystone

            I generated the tables by hand, but the sub tables have to have REV otherwise the primary key would be incomplete.

             

            Without REV on the inheriting table, there would be no way of distinguishing between versions.

             

            Cheers,

                        Andy,

            • 3. Re: Problem auditing joined inheritance.
              adamw

              Right, sorry, I was thinking of course about REVTYPE, as that's the column you don't need in the subtable.

               

              If the error message is indeed about REV, then it's quite weird ... what DB are you using? And which frameworks?

               

              Adam

              1 of 1 people found this helpful
              • 4. Re: Problem auditing joined inheritance.
                andystone

                MYSQL version 5.1.

                Seam 2.2

                Envers 1.2.2

                JDK 1.6.0_17

                JBOSS 5.1.0.GA

                HIbernate 3.3.1.GA

                 

                Cheers,

                     Andy.

                • 5. Re: Problem auditing joined inheritance.
                  adamw

                  That should work fine.

                  Can you paste in the complete stack trace you are getting?

                   

                  And maybe also the entities that you are using?

                   

                  Adam

                  • 6. Re: Problem auditing joined inheritance.
                    andystone

                    Thanks for your help I now know what the problem was.

                     

                    Due to doing everything manually, I had added REV to the base table.

                     

                    Fixing that then left the problem you pointed out above i.e. that REVTYPE is not required on the sub tables.

                     

                    Thanks for your help and thanks for a very useful product.

                     

                    Cheers,

                         Andy.