建表任务

xml 代码
  1. <project default="schemaexport">  
  2.        
  3.     <property name="lib" value="lib/schema-lib" />    
  4.      <property name="target.dir" value="build" />  
  5.     <property name="target.classpath" value="${target.dir}/classes" />  
  6.         
  7.     <path id="toolslib">    
  8.         <path location="${lib}/commons-collections-2.1.1.jar" />  
  9.         <path location="${lib}/commons-logging-1.1.jar" />  
  10.         <path location="${lib}/dom4j-1.6.1.jar" />  
  11.         <path location="${lib}/persistence-api-1.0.jar" />  
  12.         <path location="${lib}/hibernate-tools-3.2.0.beta8.jar" />  
  13.         <path location="${lib}/hibernate-annotations-3.2.0.ga.jar" />  
  14.         <path location="${lib}/hibernate-3.2.0.ga.jar" />  
  15.         <path location="${lib}/fremarker-2.3.8.jar" />  
  16.         <path location="${lib}/mysql-connector-java-5.0.4.jar" />  
  17.         <path location="${lib}/hsqldb-1.8.0.7.jar" />  
  18.         <path location="${target.classpath}" />  
  19.      </path>  
  20.   
  21.     <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" />  
  22.         
  23.     
  24.         
  25.   
  26.     <target name="schemaexport">  
  27.         <hibernatetool destdir="db">  
  28.             <annotationconfiguration configurationfile="${target.classpath}/config/hibernate.cfg.xml" />  
  29.             <hbm2ddl update="false" drop="true" outputfilename="sql.ddl" />  
  30.             <classpath>  
  31.                 <path location="${target.classpath}" />  
  32.             </classpath>  
  33.         </hibernatetool>  
  34.     </target>  
  35.   
  36.         
  37.        
  38.         
  39. </project>  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值