Skip to Main Content

SQL & PL/SQL

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!

concatenated primary key versus surrogate key

692864May 18 2009 — edited May 18 2009
hi i have this scenario...

i have 5 columns in a table(child table) and the primary key is a concatenated key on 3 columns.

now my front end is java and they are using hibernate.

when they trying to insert in this table they say that hibernate first inserts null in the table and then inserts the value in to the columns.

now since primary key cannot accomodate null values . they are asking me to create a separate primary key ( surrogate key ) and remove these 3 columns as a primary key .


which one is better ....? separate primary key or concatenated key of 3 columns

i understand that concatenated key is bad for performance. But concatenated primary key on 3 columns should be fine right...?

plz suggest wat should i do?

regards
raj
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2009
Added on May 18 2009
10 comments
1,672 views