-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: not able to audit many to many relationships using envers
PostPosted: Tue Jun 18, 2013 6:39 pm 
Newbie

Joined: Tue Jun 18, 2013 6:26 pm
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.