[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-3706) Audit Table Schema not generated using <annotationconfiguration>

Jesse Jose C (JIRA) noreply at atlassian.com
Wed May 13 21:46:13 EDT 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3706?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Jose C updated HHH-3706:
------------------------------

    Attachment: HHH-3706patch.txt

Hi Adam,

I think I found the problem, the root cause is that JPA & AnnotationConfiguration have been written quite differently. In the JPA Configuration everything is done on the createConfiguration method and a dummy doConfiguration method is overridden.  In the AnnotationConfiguration it follows the path I think as envisaged by ConfigurationTask. The code that I changed is 
  protected void doConfiguration(Configuration configuration) {
    	 
    	super.doConfiguration(configuration);
    	configuration.buildMappings();
    	AuditConfiguration.getFor(configuration);

    } in the AnnotationConfigurationTaskWithEnvers file. Now this solution is still kind of brittle because I am mimicking the behavior of getConfiguration from the ConfigurationTask base class. Ideally I would have liked to override getConfiguration but cant since it is final :( .  
The point of failure I assume with the Envers generation was that it was looking for the getClassMappings which returned empty.
I have also attached a Patch  for your perusal if you think this is the correct solution to the Jira.

Cheers

Jesse


> Audit Table Schema not generated using <annotationconfiguration>
> ----------------------------------------------------------------
>
>                 Key: HHH-3706
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3706
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: envers
>    Affects Versions: 3.3.1
>            Reporter: Kaizer
>         Attachments: HHH-3706patch.txt
>
>
> The Ant task to generate the schema for the audit tables generates schema for my entities but none of the Audit tables are. I have used the org.hibernate.tool.ant.EnversHibernateToolTask class. 
> <target name="schemaexport" depends="compile" description="Exports a generated schema to DB and file">
> 		<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.EnversHibernateToolTask" classpathref="hibernate" />
> 		<hibernatetool destdir=".">
> 			<classpath>
> 				<path refid="hibernate"/>
> 			</classpath>
> 			<!--<annotationconfiguration configurationfile="${basedir}/src/config/hibernate.cfg.xml"/>-->
> 			<jpaconfiguration persistenceunit="ConsolePU"/>
> 			<hbm2ddl drop="false" create="true" export="false" outputfilename="versioning-ddl.sql" delimiter=";" format="true" />
> 		</hibernatetool>
> </target>
> It works on using <jpaconfiguration>.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list