Envers with Custom Reverse Engineering Strategy
adamretter Jul 2, 2011 1:48 PMSo I am using a custom reverse engineering strategy (by extending org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) with Hibernate Tools to generate my Java Hibernate ORM classes from my Postgres database Schema.
I now want to start using Envers, but I cannot understand how to have my custom reverse engineering strategy or Hibernate tools add the Envers @Audited annotations to my classes.
Any ideas?
My Maven config to invoke Hibernate Tools looks like this -
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<componentProperties>
<jdk5>true</jdk5>
<ejb3>true</ejb3>
</componentProperties>
</configuration>
<executions>
<execution>
<id>generate-hibernate-java</id>
<phase>generate-sources</phase>
<goals>
<goal>hbm2java</goal>
</goals>
<configuration>
<components>
<component>
<name>hbm2java</name>
<outputDirectory>target/generated-sources/hibernate3-classes</outputDirectory>
<implementation>jdbcconfiguration</implementation>
</component>
</components>
<componentProperties>
<reversestrategy>uk.org.adamretter.hibernate.reveng.interfacestratergy.InterfaceReverseEngineeringStrategy</reversestrategy>
<packagename>uk.co.accountablecare.web.orm.generated</packagename>
</componentProperties>
</configuration>
</execution>
</executions>
<dependencies>
...
</dependencies>
</plugin>