Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What if Primary Key needs to handle NULL case?

User12652924-OracleNov 30 2005 — edited Dec 8 2005
I've built an object around an existing table that I have no control of and the primary key consists of a TYPE column and a VALUE column. However, the VALUE column allows null. But, if I choose both the Type and Value fields as the primary keys in TopLink for the object when I query one of the objects that contains NULL for VALUE then I get the following error:

The primary key read from the row [DatabaseRow(blah blah blah] during the execution of the query was detected to be null. Primary keys must not contain null.

NULL is allowed for VALUE because in those cases the TYPE is unique by itself.

I can remove the VALUE as a Primary Key, but I'm not sure what the consequences of doing that will be. Will there be any ill effects if the primary key fields are not enough to make the instance unique?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2006
Added on Nov 30 2005
1 comment
1,224 views