Audit Tables not getting generated .
guesswt Aug 18, 2010 8:28 PMI was under the assumption that audit tables get automatically created . But when I run from my app , I get the exception audit table does noes not exist .
Here is a sample
User Class - , just plain fields which is marked as @Audited
Here is my Persistence.xml
<property name="hibernate.ejb.event.post-insert"
value="org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener" />
<property name="hibernate.ejb.event.post-update"
value="org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener" />
<property name="hibernate.ejb.event.post-delete"
value="org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener" />
<property name="hibernate.ejb.event.pre-collection-update"
value="org.hibernate.envers.event.AuditEventListener" />
<property name="hibernate.ejb.event.pre-collection-remove"
value="org.hibernate.envers.event.AuditEventListener" />
<property name="hibernate.ejb.event.post-collection-recreate"
value="org.hibernate.envers.event.AuditEventListener" />
<property name="org.hibernate.envers.audit_table_suffix"
value="_VER" />
<property name="org.hibernate.envers.revision_field_name"
value="REV" />
<property name="org.hibernate.envers.revision_type_field_name"
value="REVTYPE" />
<property name="org.hibernate.envers.default_schema"
value="MY_AUDIT" />
<property name="org.hibernate.envers.revision_on_collection_change"
value="false" />
Now After my publishing my app and running the application , when i create a new user I get the following error
1. Hibernate _sequence not exist
Then i Create the sequence
2. Next I get this error , no table REVINFO found
then i create the table
3. Now I get no table USER_H found
Can somebody guide me if there are 'n' number of classes which needs to be audited should i create those tables manually . I use eclipse to build & package my EAR . There is no ant script . involved