hibernate - Using hbm2ddl when model and EM are in different projects -
i have locally-created jar file containing hibernate-annotated entities. have separate project references jar.
i need create db script using hbm2ddl, encounting difficulty. when try use task in jar file's build.xml, persistence unit can't found. when try use task in war file's build.xml, no entities found @ all.
this has that's being done others -- how create sql when entities , em in different eclipse projects built separate build scripts?
the trick here including jar file in classpath of task includes hbm2ddl:
<target name="schemaexport" depends="compile"> <hibernatetool destdir="${basedir}/sql"> <classpath> <fileset dir="${lib.dir}"> <include name="common.jar" /> </fileset> </classpath> <jpaconfiguration /> <hbm2ddl export="false" create="true" drop="true" delimiter=";" format="true" outputfilename="${project.name}-ddl.sql" /> </hibernatetool> </target>
Comments
Post a Comment