-->
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: SchemaValidatorTask and annotations
PostPosted: Fri Nov 16, 2007 2:41 pm 
Newbie

Joined: Wed Aug 08, 2007 6:38 pm
Posts: 2
I am trying to run schemavalidator Ant task and I get "An AnnotationConfiguration instance is required ... " error.


build.xml:
Code:
<target name="validateschema">
     <taskdef name="schemavalidator" classname="org.hibernate.tool.hbm2ddl.SchemaValidatorTask" classpathref="class.path"/>
     <schemavalidator  config="hibtest.cfg.xml"/>
</target>




hibtest.cfg.xml:
Code:
<hibernate-configuration>

    <session-factory>

        <!-- Database connection settings -->
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="connection.url">...</property>
        <property name="connection.username">...</property>
        <property name="connection.password">...</property>

        <!-- SQL dialect -->
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>

        <!-- Enable Hibernate's automatic session context management -->
        <property name="hibernate.current_session_context_class">thread</property>

        <mapping class="com.Xpiron.Entities.Borg"/>
        <mapping class="com.Xpiron.Entities.TimeZone"/>

    </session-factory>

</hibernate-configuration>


Schema validation worked with hbm.xml resources but not with annotated classes.

Does SchemaValidatorTask work with annotations ? Is there a way to tell it to use AnnotationConfiguration ?

Thanks,
Dragisa Krsmanovic


Top
 Profile  
 
 Post subject: Re: SchemaValidatorTask and annotations
PostPosted: Tue Nov 20, 2007 4:12 pm 
Newbie

Joined: Wed Aug 08, 2007 6:38 pm
Posts: 2
I solved this by writing my own AnnotatedSchemaValidatorTask by replacing Configuration with AnnotationConfiguration in org.hibernate.tool.hbm2ddl.SchemaValidatorTask.


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.