-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Unique constraint and null values
PostPosted: Tue Aug 23, 2011 3:00 pm 
Newbie

Joined: Tue Aug 23, 2011 2:57 pm
Posts: 6
hey all! I have a question - Is there a way to add a unique constraint with @Column but at the same time ignore this constraint for null values? (I mean, I would like to have multiple null values but don't wanna have non-null values with the same content).

Thanks :)


Top
 Profile  
 
 Post subject: Re: Unique constraint and null values
PostPosted: Tue Aug 23, 2011 4:48 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
I think that depends on which database you are using. This seems to be implemented differently. I know that MySQL has support for multiple NULL values in a UNIQUE column, but not SQL Server (last time I checked which is several years ago now).


Top
 Profile  
 
 Post subject: Re: Unique constraint and null values
PostPosted: Tue Aug 23, 2011 4:50 pm 
Newbie

Joined: Tue Aug 23, 2011 2:57 pm
Posts: 6
Thanks :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.