If I let nhibernate generate the schema, what about other indexes I may put on the tables for performance reasons?
e.g. say I need to order by a datetime field allot, I may put a index on that column.
If I let nhibernate generate the schema, what about other indexes I may put on the tables for performance reasons?
e.g. say I need to order by a datetime field allot, I may put a index on that column.
What about them? You can put them if you want. NH will not do performance tuning for you.
You can create a single-column unique index by specifying unique="true"
in a class property's mapping.
You can create a multi-column unique index by giving each participating property the same unique-key="foo"
value.
You can create a multi-column, non-unique index the same way, except the attribute to use is index="bar"
instead of unique-key="foo"
.
Finally, for more complex cases, you can create the index inside a <database-object>
element in the mapping file.