hbm2ddl生成ddl sql脚本问题

zq2022 2012-07-27 04:45:20
为什么我用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>


...全文
161 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zq2022 2012-07-29
  • 打赏
  • 举报
回复
原来的我之前的配置中outputfilename写成了outputFileName="${schema.dir}/sampledb.sql",改成了outputFileName="sampledb.sql"就可以了。
iGoodLoser 2012-07-28
  • 打赏
  • 举报
回复
<taskdef name="hibernatetool"
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>
试试这个
dxqrr 2012-07-28
  • 打赏
  • 举报
回复
build.xml
hibernate的不是hibernate.cfg.xml么
要把这个hbm2dll属性设为true
brightyq 2012-07-27
  • 打赏
  • 举报
回复
hibernate配置文件中有没有配置hibernate.dialect属性?

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧