Hi, >>>>>>>>>>>> Michael Bouschen wrote (2006-12-12 10:36:21): > Hi, > > I ran into the same problem (not in the context Hibernate): I tried to > define a unique index on a nullable column which does not work with > derby. Here is what the derby doc says in the CONSTRAINTS section: > UNIQUE Specifies that values in the column must be unique. NULL values > are not allowed. (see > http://db.apache.org/derby/docs/dev/ref/rrefsqlj13590.html. > > Is there any specific reason for not supporting unique for a nullable > column? I find it useful to be able to specify a column may or may not > have a value, but if the value is set it must be unique.
This is an open source project, so I guess the correct answer is "no one has done it, yet". Seriously: The current index mechanism is not able to handle null values, so to implement it is not a trivial undertaking. Anyway, I first step would be to craete a Jira issue for this (I believe that has not yet been done). That would at least make the wish for the feature more visible. Bernt -- Bernt Marius Johnsen, Database Technology Group, Staff Engineer, Technical Lead Derby/Java DB Sun Microsystems, Trondheim, Norway
pgpnAkVACXq1M.pgp
Description: PGP signature