i'am trying to audit two entities , which has a many to many relationship with each other.
eg
@Audited ent A { @many to many @jointable(<table name> & join columns , invers join columns) set<B> ones }
@Audited ent B {
}
I created all the _AUD tables myself, did not let envers automatically create it. Even i created an audit table for the inner join table in the same format. I'am able to get audits for all the other field changes except for the join table entries. The inner join audit table is always empty. Even if i drop it, envers does not seem to care. however when i query the entity A through audit reader interface , it is trying to query the join audit table.
I want to audit the inner join table entries. Is there anything additional configurations required for that.
please help me. I'am on a deadline
My listener config is as follows
<bean name="auditEventListener" class="org.hibernate.envers.event.AuditEventListener" />
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource" /> </property> <property name="packagesToScan" value="proper classes provided" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">SybaseASE15Dialect</prop> <prop key="hibernate.autocommit">false</prop> <prop key="hibernate.show_sql">false</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.jdbc.use_scrollable_resultset">true</prop> <prop key="hibernate.jdbc.batch_size">10240</prop> <prop key="hibernate.jdbc.fetch_size">10240</prop> <prop key="org.hibernate.envers.audit_table_suffix">_AUD</prop> </props> </property> <property name="eventListeners"> <map> <entry key="post-insert"> <ref bean="auditEventListener" /> </entry> <entry key="post-update"> <ref bean="auditEventListener" /> </entry> <entry key="post-delete"> <ref bean="auditEventListener" /> </entry> <entry key="pre-collection-update"> <ref bean="auditEventListener" /> </entry> <entry key="pre-collection-remove"> <ref bean="auditEventListener" /> </entry> <entry key="post-collection-recreate"> <ref bean="auditEventListener" /> </entry> </map> </property> </bean>
My hibernate config is like this.
|