<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才能生成索引

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


    網站導航:
     
    主站蜘蛛池模板: 亚洲高清国产AV拍精品青青草原| 亚洲精品成人网站在线播放| 国产成人免费视频| 亚欧国产一级在线免费| 亚洲综合国产精品| 精品久久免费视频| 久久这里只精品热免费99| 男人的天堂av亚洲一区2区| 久久青青成人亚洲精品| 国产乱弄免费视频| 久久免费动漫品精老司机| 亚洲av无码专区在线观看下载| 国产亚洲精品自在久久| 成年在线网站免费观看无广告| 国产一二三四区乱码免费| 亚洲乱码中文字幕在线| 免费av欧美国产在钱| 久久精品无码专区免费| 亚洲AV日韩综合一区尤物| 亚洲第一视频网站| 亚洲А∨精品天堂在线| 在线v片免费观看视频| 波多野结衣免费一区视频| 日韩成人精品日本亚洲| 亚洲国产精品午夜电影| 国产亚洲精品激情都市| 大学生一级特黄的免费大片视频| 未满十八18禁止免费无码网站| 曰批免费视频播放在线看片二 | 亚洲国产无线乱码在线观看| 西西人体44rt高清亚洲 | 激情无码亚洲一区二区三区| 久久亚洲国产成人精品性色| 亚洲视频人成在线播放| 在线观看亚洲免费视频| 青青久久精品国产免费看| 国产亚洲中文日本不卡二区 | av成人免费电影| 亚洲AV综合色区无码一二三区| 亚洲国产精品白丝在线观看| 久久丫精品国产亚洲av不卡|