`
SilverRing
  • 浏览: 71051 次
社区版块
存档分类
最新评论

[Hibernate 3] Index not created by SchemaUpdate

阅读更多
A normal index like the one below won't get created automatically if hibernate.hbm2ddl.auto is set to update.

<property 
    name="idA" 
    index="idx_id_a" 
    not-null="true" 
    type="long" 
    column="..."/> 


If the property is a primary key or it's unique, the index will be created, however. It's a hibernate bug reported here: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012.

A simple solution will be creating the index locally and migrating the creation script to the live system. If you opt for hibernate.hbm2ddl.auto = create, all data need to be backed up as this option clears the database before reconstructing the whole schema.
分享到:
评论

相关推荐

    Hibernate+中文文档

    目录 前言 1. 翻译说明 2. 版权声明 1. Hibernate入门 1.1. 前言 1.2. 第一部分 - 第一个Hibernate应用程序 1.2.1. 第一个class ...20.4. SchemaUpdate命令行选项 20.5. SchemaValidator命令行参数

    hibernate3.2中文文档(chm格式)

    HIBERNATE - 符合Java习惯的关系数据库持久化 Hibernate参考文档 3.2 -------------------------------------------------------------------------------- 目录 前言 1. 翻译说明 2. 版权声明 1. Hibernate...

    HibernateAPI中文版.chm

    HIBERNATE - 符合Java习惯的关系数据库持久化 Hibernate参考文档 3.2 -------------------------------------------------------------------------------- 目录 前言 1. 翻译说明 2. 版权声明 1. Hibernate...

    Hibernate_3.2.0_符合Java习惯的关系数据库持久化

    HIBERNATE - 符合Java习惯的关系数据库持久化 Hibernate参考文档 3.2 -------------------------------------------------------------------------------- 目录 前言 1. 翻译说明 2. 版权声明 1. Hibernate...

    NHibernate

    根据示例查询(Query By Example) ...................................................................26 实例分析..............................................................................................

Global site tag (gtag.js) - Google Analytics