Hi,

I was wondering if anyone could help me figure out how to setup a
constraint from the hibernate XML.

I need the combination of two columns to be unique.

So for instance, if the columns are Name and Type, Then you could have
the following combinations in the DB:

Name Type
John   Leader
John   Follower
Sam   Leader

I can add this to the DB directly with constraints:
ALTER TABLE [Members] ADD  CONSTRAINT [UQ_NameType] UNIQUE
NONCLUSTERED
(
        [Name],[Type] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY
= OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [MAIN]

But am not clear how to set it up in the XML.

Any help would be appreciated.

Thanks,

Nadia

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to