NHibernate - create complex index from hbm file

I create my tables and indexes from NHibernate mappings.

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"/> 

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?

+4
source share
1 answer

Assign the same 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"/> 
+5
source

Source: https://habr.com/ru/post/1347889/


All Articles