Composite Primary Key with Foreign Key
Posted by: Sid Ferreira
Date: May 06, 2008 05:13AM

Hi all, this is an extension of my discussion in http://www.symfony-project.org/forum/index.php/t/12807/
where I discuss the topic.

Is this model (Symfony's YML based) wrong based on normalization?

client:
client_id: {type: integer}

foo:
client_id: {type: integer, foreignTable: client, foreignReference: client_id}
foo_id: {type: integer}

bar:
client_id: {type: integer, foreignTable: client, foreignReference: client_id}
bar_id: {type: integer}

foobar:
client_id: {type: integer}
foo_id: {type: integer}
bar_id: {type: integer}
_foreignKeys:
fk_foo:
foreignTable: foo
references:
- { local: client_id, foreign: client_id }
- { local: foo_id, foreign: foo_id }
fk_bar:
foreignTable: bar
references:
- { local: client_id, foreign: client_id }
- { local: bar_id, foreign: bar_id }

All I want is the best option, but not based in common sense, but in rules, cause after a lot of discussions I found this way better than the usual one.

Options: ReplyQuote


Subject
Written By
Posted
Composite Primary Key with Foreign Key
May 06, 2008 05:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.