为什么我用hbm2dll生成的sql脚本里没有内容。在cmd下提示是成功了
build.xml配置如下:<target name="schema1" depends="compile">
<taskdef name="schemaexportTask"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="project.class.path"/>
<schemaexportTask
properties="${class.root}/hibernate.cfg.xml"
output="${schema.dir}/sampledb.sql"
quiet="true"
text="true"
drop="true"
create="true"
delimiter=";">
</schemaexportTask>
</target>
build.xml配置如下:<target name="schema1" depends="compile">
<taskdef name="schemaexportTask"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="project.class.path"/>
<schemaexportTask
properties="${class.root}/hibernate.cfg.xml"
output="${schema.dir}/sampledb.sql"
quiet="true"
text="true"
drop="true"
create="true"
delimiter=";">
</schemaexportTask>
</target>
hibernate的不是hibernate.cfg.xml么
要把这个hbm2dll属性设为true
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="project.classpath"/>
<target name="schemaexport">
<hibernatetool destdir="${basedir}">
<classpath path="${build.dir}"/>
<configuration
configurationfile="${build.dir}/hibernate.cfg.xml"/>
<hbm2ddl
drop="true"
create="true"
export="true"
outputfilename="helloworld-dll.sql"
delimiter=";"
format="true"/>
</hibernatetool>
</target>
试试这个