• Post Reply Bookmark Topic Watch Topic
  • New Topic

Foreign Key Mapping with a Compund Key  RSS feed

 
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
Sheriff
Posts: 37403
531
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!