I am not sure if this is considered a workaround because you already mentioned this in your question. You can use Hibernate Tools to create DDL from annotated JPA classes. You just need tools for hibernation and its dependency on the class path, and should be fine with something like the following:
<target name="schemaexport" description="Export schema to DDL file"
depends="compile-jpa">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="project.class.path" />
<hibernatetool destdir="export/db">
<jpaconfiguration persistenceunit="myPersistenceUnitName" />
<classpath>
</classpath>
<hbm2ddl outputfilename="schemaexport.sql" format="true"
export="false" drop="true" />
</hibernatetool>
</target>
On the other hand, if you use Eclipse with Webtools and configure the project settings correctly, you can simply right-click and select “Create DDL” from the context menu. More information about him can be found on the Eclipse Dali website .
source
share