2 Replies Latest reply on Apr 10, 2010 8:00 AM by Rodrigo Uchoa

    Customizing generated classes?

    Rodrigo Uchoa Novice

      Hi guys,

       

      I have and odd requirement and I was hoping someone could point me to the right direction.

       

      We are willing to use Envers in one of our projects, but we have a weird obstacle to overcome. Our current architecture demands that all JPA entities extend a particular class, called BaseEntity.

      If the entity is not a BaseEntity, it does not get flushed by hibernate. That means, it's never saved in the DB.

       

      That's our problem. Since envers generated classes do not extend our dearly beloved BaseEntity, we're not getting any audited data saved in the database. They are not being flushed.

       

      So, if I have an "User" entity annotated with @Audited, I know that somehow envers create a "clone" of this entity called "User_AUD". What I need is make this generated "User_AUD" class extend our 'BaseEntity'.

       

      Any clues?

       

      ps: Unfortunately, changing our architecture is not a possibility for now.