0

I have a hierarchical structure like this:

class Node
{
  Node Parent;
  string Name;
  string Code;
}

and I need to reflect in nhibernate mapping files that the combinations (Parent, Name) and (Parent, Code) BOTH are unique (even when Parent is null). Does nhibernate allows multiple unique-key on the same field? Something in the likes of

<many-to-one name="Parent" class="Node" column="ParentId" unique-key="CK1" unique-key="CK2" />

or some other alternative?

1 Answer 1

2

You can use <database-object> to create all the indexes you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.