本文介绍了NHibernate-从hbm文件创建一个复杂的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从NHibernate映射创建我的表和索引.

I am creating my tables and indexes from the NHibernate mappings.

例如,我按如下方式创建LastName索引:

For example, I create the LastName index as follows:

  <property name="LastName" column="LastName" type="String" length="50"  not-null="true" index="IDX_Patient_Lastname"/>

我想创建一个复杂的索引,以便例如将LastName和FirstName生成为一个索引.在NHibernate中有可能吗?

I would like to create a complex index, so that for example LastName and FirstName are generated as one index. Is this possible in NHibernate?

推荐答案

将相同的索引名称分配给FirstName:

Assign same index name to FirstName :

<property name="LastName" column="LastName" type="String" length="50"  not-null="true" index="IDX_Patient_Lastname"/>
<property name="FirstName" column="FirstName" type="String" length="50"  not-null="true" index="IDX_Patient_Lastname"/>

这篇关于NHibernate-从hbm文件创建一个复杂的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 13:27