blogjava's web log

          blogjava's web log
          ...

          build.xml

          <? xml?version="1.0"?encoding="GBK" ?>
          < project? name ="利用工具開發Hibernate" ?default ="help" ?basedir ="." >

          ????
          <!-- ?******??環境設置,可以根據自己的實際配置自行更改?*****? -->
          ????
          <!-- ?源文件目錄,?可以通過?項目->屬性->Java構建路徑?更改? -->
          ????
          < property? name ="src.dir" ?value ="./src" ? />
          ????
          <!-- ?輸出的class文件目錄,可以通過?項目->屬性->Java構建路徑?更改? -->
          ????
          < property? name ="class.dir" ?value ="./bin" ? />
          ????
          <!-- ?庫文件目錄?? -->
          ????
          < property? name ="lib.dir" ?value ="E:\lib\hbmlib" ? />

          ????
          <!-- ?定義類路徑? -->
          ????
          < path? id ="project.class.path" >
          ????????
          < fileset? dir ="${lib.dir}" >
          ????????????
          < include? name ="*.jar" />
          ????????
          </ fileset >
          ????????
          < pathelement? location ="${class.dir}" ? />
          ????
          </ path >

          ????
          <!-- ?**************************************************************? -->
          ????
          <!-- ?使用說明? -->
          ????
          <!-- ?**************************************************************? -->
          ????
          < target? name ="help" >
          ????????
          < echo? message ="利用工具開發Hibernate" ? />
          ????????
          < echo? message ="-----------------------------------" ? />
          ????????
          < echo? message ="" ? />
          ????????
          < echo? message ="提供以下任務:" ? />
          ????????
          < echo? message ="" ? />
          ????????
          < echo? message ="generate-code?????-->?運行Hbm2Java,利用?hbm.xml?文件生成Java類文件" ? />
          ????????
          < echo? message ="generate-hbm??????-->?運行HibernateDoclet,生成?Hibernate?類的映射文件" ? />
          ????????
          < echo? message ="schemaexport?????-->?運行SchemaExport,利用?hbm.xml?文件生成數據表" ? />
          ????????
          < echo? message ="" ? />
          ????
          </ target >


          ????
          <!-- ?**************************************************************? -->
          ????
          <!-- ?Hbm2Java?任務? -->
          ????
          <!-- ?**************************************************************? -->
          ????
          < target? name ="generate-code" ? >
          ????????
          < echo? message ="運行?Hbm2Java?任務,?利用?hbm.xml?文件生成Java類文件" />

          ????????
          < taskdef? name ="hbm2java"
          ?????????????classname
          ="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
          ?????????????classpathref
          ="project.class.path" >
          ????????
          </ taskdef >

          ????????
          < hbm2java? output ="${src.dir}" >
          ????????????
          < fileset? dir ="${src.dir}" >
          ????????????????
          < include? name ="**/*.hbm.xml" />
          ????????????
          </ fileset >
          ????????
          </ hbm2java >
          ????
          </ target >


          ????
          <!-- ?**************************************************************? -->
          ????
          <!-- ?HibernateDoclet?任務? -->
          ????
          <!-- ?**************************************************************? -->
          ????
          < target? name ="generate-hbm" ? >
          ????????
          < echo? message ="運行HibernateDoclet,生成?Hibernate?類的映射文件" />

          ????????
          < taskdef? name ="hibernatedoclet" ?
          ????????????classname
          ="xdoclet.modules.hibernate.HibernateDocletTask" ?
          ????????????classpathref
          ="project.class.path" >
          ????????
          </ taskdef >

          ????????
          < hibernatedoclet? destdir ="${src.dir}" ?
          ????????????excludedtags
          ="@version,@author,@todo" ?force ="true" ?encoding ="GBK" ?
          ????????????verbose
          ="true" >

          ????????????
          < fileset? dir ="${src.dir}" >
          ????????????????
          < include? name ="**/*.java" />
          ????????????
          </ fileset >

          ????????????
          < hibernate? version ="2.0" ?xmlencoding ="GBK" ? />
          ????????
          </ hibernatedoclet >
          ????
          </ target >


          ????
          <!-- ?**************************************************************? -->
          ????
          <!-- ?SchemaExport?任務? -->
          ????
          <!-- ?**************************************************************? -->
          ????
          < target? name ="schemaexport" >
          ????????
          < echo? message ="運行SchemaExport,利用?hbm.xml?文件生成數據表" />

          ????????
          < taskdef? name ="schemaexport" ?
          ????????????classname
          ="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask" ?
          ????????????classpathref
          ="project.class.path" >
          ????????
          </ taskdef >

          ????????
          < schemaexport? config ="${src.dir}/hibernate.cfg.xml" ?quiet ="no" ?
          ????????????text
          ="no" ?drop ="no" ?output ="schema-export.sql" >
          ????????
          </ schemaexport >
          ????
          </ target >

          </ project >

          posted on 2006-04-15 20:08 record java and net 閱讀(241) 評論(0)  編輯  收藏 所屬分類: 常用配置代碼

          導航

          常用鏈接

          留言簿(44)

          新聞檔案

          2.動態語言

          3.工具箱

          9.文檔教程

          友情鏈接

          搜索

          最新評論

          主站蜘蛛池模板: 亚东县| 丹凤县| 芜湖县| 阿鲁科尔沁旗| 罗甸县| 鄂尔多斯市| 汶川县| 靖远县| 西丰县| 五常市| 阿克苏市| 普洱| 德江县| 郸城县| 五寨县| 怀仁县| 年辖:市辖区| 泾源县| 盐亭县| 曲阜市| 杭锦旗| 饶河县| 钟山县| 库尔勒市| 泗阳县| 大渡口区| 林芝县| 龙胜| 乌拉特后旗| 若尔盖县| 米泉市| 本溪市| 阿鲁科尔沁旗| 章丘市| 乐安县| 宝丰县| 永泰县| 颍上县| 南京市| 阿拉善右旗| 清河县|