db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <dan...@nuix.com>
Subject Re: unique columns must be nullable ?
Date Tue, 12 Dec 2006 22:12:26 GMT
Mike Matrigali wrote:
> Out of curiousity what behavior does Hibernate expect when 2 nulls are 
> inserted into a "unique" nullable column?

That's my issue with unique nullable columns too.  If it were to be 
truly unique you could only ever have one null in that column for the 
entire table, which would all but make it pointless to set it to null.

In any case I usually use a join table for optional 1-to-1 relationships 
anyway.  It provides better forwards compatibility.  For instance, if 
you ever have to upgrade that relationship to 1-to-many, you won't need 
to migrate anything.


Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

View raw message