When I try to create a schema using the SchemaExportTask I get the error
I get the error
Schema text failed: An AnnotationConfiguration instance is required to use <mapping class="nz.org.model.account.Account"/>
I have had a pretty good search around the web to no avail. I am guessing I need to declare something within my test_hibernate.cfg.xml? Surely I do not need to instantiate this class when I am generating the schema, right? I am using the persistence annotations in the Account class
(@Entity and @Id)
Ant snippet
Code:
<target name="schema-export">
<taskdef classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="master.classpath" name="schemaexport" />
<schemaexport drop="true" config="${test.dir}/test_hibernate.cfg.xml" output="${sql.dir}/schema.sql" quiet="false" text="false">
</schemaexport>
</target>
and test_hibernate.cfg.xml
Code:
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="connection.url">
jdbc:mysql://localhost/
</property>
<property name="connection.username">discomanifesto</property>
<property name="connection.password"></property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<!-- Mappings -->
<!--<mapping package="com.discomanifesto.model."/>-->
<mapping class="nz.org.mike.model.account.Account" />
</session-factory>
</hibernate-configuration>
Help!
Thanks heaps,
Mike Casey