multiple unique keys in nhibernate

房东的猫 提交于 2019-12-05 18:28:33

If you don't care about the index names in the database, you can map it like this:

<property 
  name="Description" 
  column="Description" 
  type="String" 
  unique-key="Description, Ordering_Description" />

<property 
  name="Ordering" 
  column="Ordering" 
  type="Int32" 
  unique-key="Ordering_Description" />

you can provide a comma separated list of index names. All columns which have the same name in the list are added to the same index.

Use <database-object> to create additional indexes.

5.6. Auxiliary Database Objects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!