Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Foreign Key Mapping with a Compund Key

 
binnym Mathew
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am now stuck with an issues in setting the annotations right.

The issue is i have table which has a composite key [2 primary Keys] and another table which has a composite key in which one key of the initial table.

Table: Feature Master
FeatureId Pk
FeatureName
Description
Intermidate Pk

One to Many [ One record in Feature Master can have multiple records in cfg Master]

Table: CfgMaster
FeatureId FK
configName Pk
datakey
Intermidate pk

Can anyone please highlight the structure of tables on the above schema.

Any Help is much appreciated.

Thanks in Advance.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Binnym,
Welcome to CodeRanch!

I don't know how to map that either. It sounds really complicated. You might want to consider using an artificial generated key to break the relationship of "immediate" being used for two things. It might actually be worth doing that anyway since ConfigName sounds like something that could change. It's best not to have primary keys that change.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic