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.文檔教程

          友情鏈接

          搜索

          最新評論

          主站蜘蛛池模板: 光泽县| 蓬安县| 靖远县| 木里| 紫金县| 甘南县| 烟台市| 如东县| 房山区| 晋州市| 筠连县| 安丘市| 额敏县| 宣恩县| 兴安盟| 手机| 浦北县| 沙田区| 象州县| 勐海县| 调兵山市| 渝中区| 泊头市| 山东省| 区。| 论坛| 霞浦县| 内黄县| 泉州市| 黄平县| 蓬安县| 邛崃市| 平江县| 布拖县| 临湘市| 合肥市| 南开区| 剑川县| 云和县| 昭通市| 伊川县|