I'm using annotations in my pojo classes, and I have an Ant task to output a DDL file from those classes. But, even though I specify drop="false" in the hbm2ddl task, the drop statements are still generated. Why? Bug?
I'm using MySQL 4.0.17 with MySQL Connector 3.0.14.
Here's an excerpt from my Ant file:
Code:
<target name="generate-schema" depends="">
<hibernatetool destdir="${sql.dir}">
<classpath>
<path refid="compile-classpath"/>
<pathelement location="${build.classes}"/>
</classpath>
<annotationconfiguration configurationfile="./hibernate.cfg.xml"/>
<hbm2ddl create="true" drop="false" export="false" outputfilename="whatever.sql"/>
</hibernatetool>
</target>
And here's the contents of my hibernate.cfg.xml:
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="java:hibernate/SessionFactory">
<property name="hibernate.connection.url">jdbc:mysql://192.168.2.5:3306/housing</property>
<property name="hibernate.connection.username">housing</property>
<property name="hibernate.connection.password">housing</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.default_catalog">housing</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_sql_comments">false</property>
<mapping package="org.jini.housing.data"/>
<mapping class="org.jini.housing.data.Housing"/>
<mapping class="org.jini.housing.data.HousingProperty"/>
<mapping class="org.jini.housing.data.Neighborhood"/>
<mapping class="org.jini.housing.data.Tenant"/>
<mapping class="org.jini.housing.data.TenantProperty"/>
<mapping class="org.jini.housing.data.TenantType"/>
<mapping class="org.jini.housing.data.TenantVersion"/>
<mapping class="org.jini.housing.data.TenantVersionProperty"/>
</session-factory>
</hibernate-configuration>
Hibernate version:
Hibernate 3.1rc1
Hibernate Annotations 3.1beta6
Hibernate Tools 3.0alpha1