-->
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.  [ 2 posts ] 
Author Message
 Post subject: Pb creating envers table for auditing using hibernate
PostPosted: Thu Sep 24, 2009 5:57 am 
Newbie

Joined: Thu Sep 24, 2009 5:43 am
Posts: 1
Hello
I'm trying to use envers to be able to use the version,audit tables
I'm using
- envers-1.2.1
- hibernate-tools-3.2.0.ga
- hibernate-core-3.3.10.ga

My "hibernate-context.xml" is
Code:
            
<prop key="hibernate.cache.provider_class">${hibernate.provider_class}</prop>
<prop key="hibernate.ejb.event.post-insert">org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener</prop>
<prop key="hibernate.ejb.event.post-update">org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener" </prop>
<prop key="hibernate.ejb.event.post-delete">org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener</prop>
<prop key="hibernate.ejb.event.pre-collection-update">org.hibernate.envers.event.AuditEventListener</prop>
<prop key="hibernate.ejb.event.pre-collection-remove">org.hibernate.envers.event.AuditEventListener</prop>
<prop key="hibernate.ejb.event.post-collection-recreate">org.hibernate.envers.event.AuditEventListener</prop>

I'm using ant with maven to create my table
My build.xml is
Code:
<target name="generateDDL">
  <mkdir dir="${basedir}/target/generated-sources/schema" />
  <taskdef classpathref="toolslib" name="hibernatetool" classname="org.hibernate.tool.ant.EnversHibernateToolTask"/>
  <hibernatetool destdir="${basedir}/target/generated-sources">
      <classpath refid="maven.test.classpath" />
      <annotationconfiguration configurationfile="${basedir}/src/main/resources/common/hibernate.cfg.xml"/>
      <hbm2ddl drop="false" create="true" export="${export}"
outputfilename="./schema/schema.ddl" delimiter=";" format="true" />
    </hibernatetool>
</target>


I succeded to create the usual table but not the "_AUD" tables, no errors are thrown
Anybody suceed to make envers works with hibernate using hibernate-context.xml and not with "JPA and persistence.xml" ?
Thanks for your replies


Top
 Profile  
 
 Post subject: Re: Pb creating envers table for auditing using hibernate
PostPosted: Sun Oct 04, 2009 10:50 am 
Newbie

Joined: Sat May 19, 2007 10:15 am
Posts: 2
It seems to be difficult to find a running example with this configuration. Did you succeeded ?
i think we should merge this post : viewtopic.php?f=1&t=998844&p=2419305#p2419305


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

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.