【问题标题】:Is it possible to create one index for more than one column? hiberanate是否可以为多列创建一个索引?休眠
【发布时间】:2014-12-15 09:31:33
【问题描述】:

我想在 xml 文件中为集合的多列只创建一个索引或复合索引。有正确的方法吗?我找不到任何相关的东西。我看到在sql上是可以的。

这是我的例子;

<set name="properties" fetch="join" lazy="false" table="PLN_DEMAND_ORDER_ITM_PROPERTY">
    <key>
        <column name="ORDER_ID" index="IDX_PLN_DOIP_ORDER_ID"/> <=
        <column name="LINE_NO" index="IDX_PLN_DOIP_ORDER_ID"/>  <= for both column only one index is needed
    </key>
          .
          .
          .
</set>

【问题讨论】:

    标签: java database hibernate collections hibernate-mapping


    【解决方案1】:
    Multiple columns can be grouped by simply **specifying the same index name** into the same index as you have clearly done it.
    

    这个link可以让你更好的理解。希望这会有所帮助..

    【讨论】:

      猜你喜欢
      • 2014-05-14
      • 1970-01-01
      • 2015-04-17
      • 2013-01-27
      • 1970-01-01
      • 2011-04-03
      • 1970-01-01
      • 1970-01-01
      • 2016-06-22
      相关资源
      最近更新 更多