3 Replies Latest reply on Apr 15, 2011 5:54 AM by Adam Warski

    @AuditJoinTable usage?

    Robin G Newbie

      @AuditJoinTable usage?

       

      I'm trying to rename the extra audit join tables, but so far using @AuditJoinTable seems to have no effect.

       

      So here's basically what my classes look like:

       

       

      public abstract class Fruit<T extends...> {
      
          private T         parent;
          private List<T> children;
      
          ...
      }
      
      public class Apple extends Fruit<Apple>{
      
          ...
      }
      

       

       

      From that, the name of the extra audit join table defaults to "Apple_Apple_AUD". Let's say I want rename it to "A_A_AUD". How would I use @AuditJoinTable to do that?

       

      Note that Apple isn't the only class that extends Fruit. I use HBM.

        • 1. @AuditJoinTable usage?
          Adam Warski Master

          And you're annotating the children field?

           

          Adam

          • 2. Re: @AuditJoinTable usage?
            Robin G Newbie

            I've tried doing the following just to see if a "a_a_aud" table would appear:

             

            public abstract class Fruit<T extends...> {
             
                private T         parent;
                @AuditJoinTable(name="a_a_aud") 
                private List<T> children;
             
                ...
            }
             
            public class Apple extends Fruit<Apple>{
             
                ...
            }
            
            

             

            Clearly this is not the correct solution since all subclasses of Fruit would now have the same audit join table name, despite having different table and audit table names.

            But still, there was no "a_a_aud" table, and the "apple_apple_aud" table remained.

             

            I also tried to be more explicit by redeclaring the parent and children variables inside Apple, and annotating children with the same annotation there, to no effect.

             

            Finally I tried using @AuditJoinTable(name="_aud", inverseJoinColumns = @JoinColumn(name="parent")) instead in both scenarios, also to no effect.

            • 3. Re: @AuditJoinTable usage?
              Adam Warski Master

              Hmm unfortunately there's no way to override this - please create a feature request in JIRA.

               

              Adam