I use Hibernate to automatically create my database for testing, and I have some tables in my schema that contain static data that take a very long time to import. I used to use the following code in an assembly file to create a database (from map files):
<target name="schema-gen" depends="hibernate-gen">
<taskdef name="schemaexport" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="project.classpath" />
<schemaexport properties="resources/hibernate.properties" text="false" quiet="false" delimiter=";" output="schema.sql">
<fileset dir="${build.doclets}">
<include name="**/*.hbm.xml" />
<exclude name="**/inert/*.hbm.xml" />
</fileset>
</schemaexport>
</target>
.Hbm.xml files were generated using XDoclet. I move on to using Hibernate annotations for mapping, so I go on to hibernatetools to create a schema:
<target name="annotations-export" depends="hibernate-gen">
<hibernatetool destdir="${basedir}">
<annotationconfiguration configurationfile="${basedir}/resources/hibernate.cfg.xml" propertyfile="${basedir}/resources/hibernate.properties" />
<classpath>
<path refid="project.classpath" />
</classpath>
<hbm2ddl drop="true" create="true" export="true" outputfilename="schema.sql" delimiter=";" format="true" />
</hibernatetool>
</target>
I would like to tell hbm2ddl to leave the classes in the "inert" package, as before, using schemaexport. Does anyone know if there is a way to do this?