<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    我愛oo,我愛java

    交流blog QQ:421057986 oofrank@donews

    使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案


    1:abator下載:http://ibatis.apache.org/abator.html
    2:將abator安裝到eclipse中
    3:此時可以新建一種文件類型:Abator for iBATIS Configuration File,建立一個
    4:在 jdbcConnection 中設(shè)置要mapping的數(shù)據(jù)庫的jdbc連接
      classPathEntry 是你的jdbc driver類路徑
    5:javaModelGenerator,sqlMapGenerator,daoGenerator 分別設(shè)置 java dataObject、sql mapping文件和 DAO 接口、實現(xiàn)類的生成位置:targetPackage 目標(biāo)包,targetProject:eclipse項目
    6:daoGenerator 中可以設(shè)置屬性  type: ibatis 或 spring 指定生成的dao實現(xiàn)類是使用com.ibatis.dao.client.template.SqlMapDaoTemplate
    還是
    org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
    7: table 中 tableName 指定要處理的表名
      可以有多個table
    8:table中可以包含子元素 generatedKey: 使Insert方法可以返回值--由指定的column mapping
    9:generatedKey中的sqlStatement屬性可以是獲取sequence的SQL,也可以是獲取自增值的SQL
      比如:Oracle的 select theSequence.nextVal from dual
           SQLServer的 SELECT @@IDENTITY as  column_name
    10:保存文件,選中文件,右鍵菜單選擇Generate iBATIS Artifacts! ok...



    使用abtor生成的iBatis代碼出現(xiàn)xml解析錯誤的解決方案
    如果按上述方式生成的代碼有xml解析錯誤:  請下載這個

    注意,該文件名為Abator.rar.txt實際是一個rar文件,只是上傳服務(wù)器有文件類型限制 所以只好加了擴展名txt。
    請去掉.txt后解壓。

    使用
    org.apache.ibatis.abator.core_0.5.1.jar
    替換調(diào)你的 eclipse\plugins 的同名文件 即可。

    然后重新生成代碼。 OK 應(yīng)該可以咯....

    我改了一點代碼,需要可以留言。

    posted on 2006-01-21 13:51 兼聽則明 閱讀(9078) 評論(12)  編輯  收藏 所屬分類: java

    評論

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2006-03-28 21:12 andyking

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE abatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Abator for iBATIS Configuration 1.0//EN"
    "http://ibatis.apache.org/dtd/abator-config_1_0.dtd">

    <abatorConfiguration>
    <abatorContext> <!-- TODO: Add Database Connection Information -->
    <jdbcConnection driverClass="net.sourceforge.jtds.jdbc.Driver"
    connectionURL="jdbc:jtds:sqlserver://localhost:1433/test;tds=8.0;lastupdatecount=true"
    userId="sa"
    password="">
    <classPathEntry location="D:/tools/driver/jtds-1.2.jar" />
    </jdbcConnection>

    <javaModelGenerator targetPackage="com.ibatis" targetProject="." />
    <sqlMapGenerator targetPackage="com.ibatis.sqlmap" targetProject="." />
    <daoGenerator type="IBATIS" targetPackage="com.ibatis" targetProject="." />

    <table schema="" tableName="dbo.user_property">
    <generatedKey sqlStatement="SELECT @@IDENTITY as column_name" identity="true" column=""/>
    </table>

    </abatorContext>
    </abatorConfiguration>

      回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2006-03-28 21:14 andyking

    Generation Warnings Occured
    Table dbo.user_property does not exist, or contains only LOB fields
    請問大哥這是什么原因!明明數(shù)據(jù)庫里面有這張表!為什么不能生成!  回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2006-03-29 09:28 oofrank

    @andyking
    <table schema="" tableName="dbo.user_property">
    改成
    <table schema="dbo" tableName="user_property">
    試試

    我看你的沒什么問題  回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2006-06-13 13:33 tedeyang

    我也碰到過xml解析錯誤的現(xiàn)象。后來發(fā)現(xiàn)是ibatis的配置中沒有打開namespace這個選項,要這樣
    <sqlMapConfig>
    <settings
    useStatementNamespaces="true"
    />
    ...
    不知道你指的錯誤是不是類似的情況?

    另外,我不太明白abator自動生成的xxxExample類和xxxselectByExample()怎么使用,能貼一段示例代碼嗎?

    期待您的回信:tedeyang@msn.com  回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2006-12-03 17:56 houya

    對于字段數(shù)不是很多的表abator生成的xml文件包含insert update select 等方法。
    而對于字段數(shù)很多的表,abator確只能生成resultMap和動態(tài)條件,其他的insert和update等都沒有。請問這是為什么啊。  回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2007-09-19 17:11 china_world

    ORA-00604: error occurred at recursive SQL level 1
    ORA-12705: Cannot access NLS data files or invalid environment specified

    ORA-00604: error occurred at recursive SQL level 1
    ORA-12705: Cannot access NLS data files or invalid environment specified

    請問這個如何解決啊 謝謝!!

      回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2009-08-20 18:09 fieldwolf2

    myeclipse連接oracle出現(xiàn)ora-12705錯誤的解決辦法: MyEclipse DB Brower建立oracle數(shù)據(jù)庫連接的時候,報出下面的錯誤. java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 java.sql.SQLException: ORA-12705: invalid or unknown NLS parameter value specified 修改eclipse\eclipse.ini中的-Duser.language=*保持與windows XP控制面板中"區(qū)域和語言選項"中選定的語言區(qū)域一至; 如:將"-Duser.language=en"修改為"-Duser.language=zh"
      回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2014-06-25 21:58

    個  回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2015-03-24 14:26 陳春熖

    The specified target project directory fgms_easyui does not exist  回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2015-04-02 10:25 generation warning occured

    Run complete With Warning
    Reasion:
    generation warning occured這個是怎么回事?  回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案 2016-03-08 18:52 趙國棟

    我生成成功了。可是當(dāng)我想 拼寫 WHERE *** OR *** 的時候,我找不到相關(guān)的方法。只有
    is null
    not is null
    =
    >=
    <=
    等一些 工具方法。并且他們都是 and 的關(guān)系。
    請樓主看到后賜教。!謝謝了。  回復(fù)  更多評論   

    # re: 使用abator自動生成ibatis代碼的經(jīng)驗 及碰到的問題的解決方案[未登錄] 2016-08-03 11:27 minmin

    請問下:自動生成的時候 生成java文件和sqlMap文件少了個字段是怎么回事,  回復(fù)  更多評論   

    主站蜘蛛池模板: 中国好声音第二季免费播放| 精品免费久久久久久久| 久久精品国产亚洲麻豆| 免费福利在线播放| 国产成人亚洲精品91专区高清| 亚洲中文字幕在线观看| 一个人免费观看在线视频www| 国产午夜亚洲精品不卡免下载| 亚洲αv在线精品糸列| 噼里啪啦电影在线观看免费高清 | 日本免费人成视频在线观看| 亚洲日韩AV一区二区三区四区| 久久久久亚洲AV成人网人人软件 | 成年女人毛片免费播放人| 二级毛片免费观看全程| 亚洲大尺码专区影院| 亚洲中文字幕视频国产| 无码精品A∨在线观看免费| 中文字幕在线免费看线人| 亚洲日韩中文字幕无码一区| 久久亚洲国产欧洲精品一| 日产乱码一卡二卡三免费| 四虎影视在线影院在线观看免费视频 | 最近中文字幕mv手机免费高清| 成人无码精品1区2区3区免费看| 亚洲AV永久无码精品一福利| 久久亚洲精品成人AV| 亚洲伊人久久大香线蕉综合图片| 最近免费中文字幕4| 99精品视频免费在线观看| 最近更新免费中文字幕大全| 国产精品亚洲一区二区无码| 亚洲一区二区免费视频| 亚洲AV无码专区亚洲AV伊甸园| 日韩亚洲精品福利| 国内外成人免费视频| 两性刺激生活片免费视频| 一级毛片不卡片免费观看| 最新亚洲成av人免费看| 国产99视频精品免费视频76| 青青青亚洲精品国产|