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

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

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

    itVincent Blog - Java Working Fun!

    技術引領時代!
    posts - 117, comments - 181, trackbacks - 0, articles - 12

    [Hibernate]SchemaUpdate建立索引問題

    Posted on 2008-12-02 10:57 itVincent 閱讀(840) 評論(0)  編輯  收藏

    [Hibernate]SchemaUpdate建立索引問題

    關鍵字: hibernate schemaupdate 索引
    當hibernate的hbm2dll配置為
    1. hibernate.hbm2ddl.auto update  
    將會發現Hibernate不會為我們創建任何自定義的索引(不包括主鍵跟外鍵索引),不論你使用xml方式或者annotation進行聲明配置
    這個問題在Hibernate的JIRA多次出現,甚至有人專門為此發布了打了補丁的hibernate.jar
    這個所謂的bug,在目前已發布的hibernate的版本中,一直都沒有解決,或者說不予理睬(Gavin King個人認為這個不是bug)

    這里引用hibernate 3.2.5版的jira
    http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012

    引用Hibernate上官方的解釋
    引用

    The hibernate.hbm2ddl.auto=update setting doesn't create indexes
    SchemaUpdate is activated by this configuration setting. SchemaUpdate is not really very powerful and comes without any warranties. For example, it does not create any indexes automatically. Furthermore, SchemaUpdate is only useful in development, per definition (a production schema is never updated automatically). You don't need indexes in development.

    Hibernate doesn't generate the database indexes I want in the schema!

    Automatic schema export (and update) by Hibernate tools is only useful in development. You never need indexes in development, they are purely for performance and scalability tuning in production systems. Production schemas are never automatically generated, at least not completely. A DBA adds indexes to the automatically generated schema during SQL tuning and testing of the application, before going into production with the (possibly automatically generated) base schema, and her handwritten optimized DDL. Also note that optimized DDL is highly vendor specific and totally dependent on the environment (SQL execution plans, tablespace configuration, caches, etc). Even if Hibernate developers would encourage you to automatically generate production-ready schemas (we don't, and we also don't like ad-hoc SQL tuning by throwing a bunch of indexes onto a schema), Hibernate could never offer such a feature.
    轉自: http://xmkevinchen.javaeye.com/blog/196372


    郁悶非常的一個"BUG",只有把hibernate.hbm2ddl.auto update  改成create才能生成索引

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


    網站導航:
     
    主站蜘蛛池模板: 色老头综合免费视频| 久久国产乱子伦精品免费看| 苍井空亚洲精品AA片在线播放 | 久久精品国产大片免费观看| 久久久久亚洲av成人无码电影| 久久久亚洲裙底偷窥综合| 瑟瑟网站免费网站入口| 久久国产乱子免费精品| 久久亚洲日韩看片无码| AA免费观看的1000部电影| 国产亚洲3p无码一区二区| 日韩国产欧美亚洲v片 | 亚洲国产精品综合福利专区| 国产乱子伦精品免费视频| 毛片基地免费观看| 亚洲人成网站影音先锋播放| 美女黄频a美女大全免费皮| 亚洲国产成人a精品不卡在线| 国产精品久久亚洲不卡动漫| 免费高清国产视频| 亚洲精品视频免费| 亚洲成av人片在线天堂无| 57PAO成人国产永久免费视频| 亚洲成AV人片在| xxxxxx日本处大片免费看| 日韩人妻无码免费视频一区二区三区 | 亚洲色婷婷综合开心网| 精品国产日韩亚洲一区91| 亚洲最大av无码网址| 99国产精品免费观看视频| 亚洲一区中文字幕久久| 国产一区二区三区免费观看在线| 亚洲日韩涩涩成人午夜私人影院| 日本高清不卡aⅴ免费网站| 亚洲精品人成电影网| 在线a免费观看最新网站| 亚洲综合日韩中文字幕v在线 | 国产精品亚洲不卡一区二区三区 | 中文字幕在线免费看线人| 国产日韩成人亚洲丁香婷婷| 日本免费大黄在线观看|