Many relation between 2 tables
Posted: Thu 27 Aug 2009 15:05
Hi
I have the follwing tables (* = primary keys)
Account
*CountryId
*AccountNo
Desc
Params
*Id
CountryId
Param1AccountId
Param2AccountId
And then the following FK
ACCOUNT1_FK (PARAM1ACCOUNTID, COUNTRYID)
ACCOUNT2_FK (PARAM2ACCOUNTID, COUNTRYID)
When I generate the entity model i get an error saying (badly translated)
Problem with mapping fragmen with start at row x,x: 2 entities with possible diffrent keys is mapped to the same row. Please verify that these 2 mapping fragments maps both ends of the AssosiasionSet to the corresponding column.
If I look att the mapping details of the associasion the account has accountNo and countryCode but the params table has the Id.
I can't figure out why it maps this way. Is it becouse there are multiple association between the tables? As far as I can see, the database constrains are correct and if I do a Linq to Oracle (not entity map) it seems to work.
Is it a bug? if so, is there any way to correct this manually?
[/b]
I have the follwing tables (* = primary keys)
Account
*CountryId
*AccountNo
Desc
Params
*Id
CountryId
Param1AccountId
Param2AccountId
And then the following FK
ACCOUNT1_FK (PARAM1ACCOUNTID, COUNTRYID)
ACCOUNT2_FK (PARAM2ACCOUNTID, COUNTRYID)
When I generate the entity model i get an error saying (badly translated)
Problem with mapping fragmen with start at row x,x: 2 entities with possible diffrent keys is mapped to the same row. Please verify that these 2 mapping fragments maps both ends of the AssosiasionSet to the corresponding column.
If I look att the mapping details of the associasion the account has accountNo and countryCode but the params table has the Id.
I can't figure out why it maps this way. Is it becouse there are multiple association between the tables? As far as I can see, the database constrains are correct and if I do a Linq to Oracle (not entity map) it seems to work.
Is it a bug? if so, is there any way to correct this manually?
[/b]