I just started to use Hibernate, and I was trying generate the sql schema for my application. I was using the ant script listed below.
When the text property is set to "no", and no database is previously created, the database schema is not generated but the
ant script reports a successful build.
If the database was manualy created (empty database), the generation worked fine.
I think that the SchemaExportTask should report that the database schema was not created because the database
doesn't exist (if text is set to "no").
Did someone noticed this behaviour before?
Best,
Sergiu
<target name="generate-schema">
<taskdef name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="classpath"/>
<schemaexport
properties="hibernate.properties"
quiet="no"
text="yes"
drop="no"
delimiter=";"
output="${build.conf.dir}/schema-export.sql">
<fileset dir="${build.conf.dir}/">
<include name="*.hbm.xml"/>
</fileset>
</schemaexport>
</target>
|