Multi column unique constraint w/nullable values

1 message Options
Embed this post
Permalink
Daryl Stultz

Multi column unique constraint w/nullable values

Reply Threaded More More options
Print post
Permalink
Hello,

I spent an afternoon banging my head against the desk trying to figure out
why OpenJPA was inserting 0 instead of null for a nullable foreign key. It
turns out I have a unique constraint on the fk column that includes 2 other
columns, all three are nullable. OpenJPA seems to disregard the nullable
with the unique constraint annotated. I removed the unique constraint
annotation (but left it in the database) and the problem went away.

Hope that helps someone.

--
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:[hidden email]