【问题标题】:Java Hibernate org.hibernate.annotations.IndexJava Hibernate org.hibernate.annotations.Index
【发布时间】:2013-07-21 01:36:16
【问题描述】:

我正在我的数据库中实现索引我想知道这个注释是否只适用于 D.D.L. We got a legacy System this sentence dont work if the schema is generated?.

被忽略了?

我的代码

@org.hibernate.annotations.Table(appliesTo = "person",indexes={@org.hibernate.annotations.Index(name = "part_of_name",columnNames={"c01"})})  

我正在检查文档,INDEX 的文档几乎是空的。来看看

Doc for Index

【问题讨论】:

    标签: java hibernate indexing


    【解决方案1】:

    你猜对了,这基本上是一个 DDL 注解。 @Index 只有通过设置 hibernate.hbm2ddl.auto hibernate 属性来更新才会产生效果(即创建一个新索引)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-10
      • 2010-10-20
      • 2014-05-11
      • 1970-01-01
      • 2010-12-04
      • 2011-03-10
      • 2014-05-08
      • 2017-09-04
      相关资源
      最近更新 更多