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

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

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

    Java Blog for Alex Wan

    Let life be beautiful like summer flowers and death like autumn leaves.

    統計

    留言簿(10)

    BlogJava

    Blogs

    DIV+CSS

    JQuery相關

    友情鏈接

    常去的地方

    數據供應

    閱讀排行榜

    評論排行榜

    appfuse中生成以S結尾的數據表對應的代碼出錯的解決方案

    首先使用appfuse是應該盡量避免以S結尾的單詞來作為數據表名,但是很多時候并不是這樣的。數據表的名字不能改變的時候我們只能從其他方面想辦法了!
    在google搜索相關的信息,只找到這一篇文章是有用的,并給予我修改的思路。

    http://jira.codehaus.org/browse/MIDDLEGEN-13?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel
    The algorithm for creating singular versions of table names doesn't account for singular words that end in "s". For example, a table called MumbleFooStatus becomes MumbleFooStatu
    Suggestion #1: in Util.singularise(), check for a vowel other than "e" before a final "s".

    Suggestion #2: change the default behaviour to not singularise tablenames. I think it's bad form for a tool to change the names of my data objects without my consent.

    Workarounds: specify table names in build.xml, or if you're using the hibernate plugin, fix the table names in the <dbname>-prefs.properties generated by the plugin and re-run middlegen.

    第二點中提到改變middlegen的默認行為讓其不去單數化數據表名。

    我們要做的有幾個步驟(粗略的看了middlegen源碼做的修改):
    1:下載middlegen源碼,下載地址
    http://sourceforge.net/project/downloading.php?group_id=36044&use_mirror=jaist&filename=middlegen-2.1-src.zip
    2:解壓并編輯MiddlegenTask.java中的代碼

    private static boolean _singularize = true;
    改成
    private static boolean _singularize = false;
    3:重新編譯并打包成jar,在middlegen的根目錄下輸入命令行命令:ant jar即可
    4:將新的middlegen-2.1.jar替換目標項目(已生成)中extras\middlegen\lib\middlegen-2.1的middlegen-2.1.jar
    這樣,在生成以S結尾的數據表名對應的代碼就不會出錯了!
    但是這樣做始終有不好的地方:在表示對象復數的地方就會出現不盡人意的代碼了,但是不管怎么樣,代碼還是生成出來了,后期的工作就可以依靠手動去修改。
    所以還是盡量去遵循不以S結尾的單詞作為數據表名。 



    Let life be beautiful like summer flowers and death like autumn leaves.

    posted on 2008-06-07 09:28 Alexwan 閱讀(363) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲人成色777777老人头| 一级**爱片免费视频| 久久精品国产这里是免费| 亚洲国产精品免费观看| 亚洲а∨天堂久久精品| 亚洲免费精彩视频在线观看| 99re6在线精品免费观看| 亚洲中文字幕无码日韩| a在线观看免费视频| 亚洲午夜久久久影院| 久久久亚洲精华液精华液精华液 | 国产精品白浆在线观看免费| 亚洲国产精品一区第二页| 在线看片免费人成视频福利| 亚洲国产精品va在线播放| 91精品国产免费久久国语麻豆| 91亚洲视频在线观看| 性感美女视频在线观看免费精品 | 亚洲成人黄色网址| 日本免费网址大全在线观看| 2017亚洲男人天堂一| 免费观看日本污污ww网站一区| 久久国产福利免费| 亚洲色图校园春色| 国产午夜影视大全免费观看| 精品多毛少妇人妻AV免费久久| 国产亚洲美女精品久久久久狼 | 亚洲AV无码专区亚洲AV桃| 亚洲日韩在线第一页| 国产白丝无码免费视频| 亚洲欧美日韩一区二区三区| 国产亚洲精品福利在线无卡一| 91人成网站色www免费下载| 亚洲av无码日韩av无码网站冲| 国产亚洲精aa成人网站| 四虎免费影院ww4164h| 亚洲精品成人片在线播放| 精品久久8x国产免费观看| 国产AV无码专区亚洲AV琪琪| 亚洲av日韩av不卡在线观看| 无码A级毛片免费视频内谢|