below are the definitions of two tables in my MySQL database. i'm using the database in conjunction with the data entiy modeling tools in ASP .NET (vs 2010). i'm trying to create a proper / valid association, a 1 to many relationship, within the model from the utathleteinfo table to the utinout table.
i create the association on the model side (right click in white space, choose "Add" and select "Association"). then i rebuild. On the model side i get an error that reads:
"Error 1 Error 3004: Problem in mapping fragments starting at line 193:No mapping specified for properties utinout.utathleteinfoAthle
in Set utinouts.
An Entity with Key (PK) will not round-trip when:
Entity is type [STT1Model.utinout]
TT.edmx 194 93 MBSC.DAL"
To me this indicates that I can find more information on what this error is saying within the XML of the .edmx file. Though I can see that it's telling me that there there is no mapping specified for the the propertyies utinout.utathleteinfoAthle
in Set utinouts. I can't find where to do this in the model, Because when i click on the property in the model browser, the i get a message in the Mapping Details window that states:
"Mappings are not allowed for an association over exposed foreign keys." (not sure why this is or what this means. So where can I edit the mappings for this?
When i switch to the XML description of the model and go to line 194, (as indicated above) the following description of the utinout table is found:
<ScalarProperty Name="AtAProgram" ColumnName="AtAProgram" />
<ScalarProperty Name="AthleteUid" ColumnName="AthleteUid" />
<ScalarProperty Name="InOutAUid" ColumnName="InOutAUid" />
<ScalarProperty Name="InTime" ColumnName="InTime" />
<ScalarProperty Name="OutTime" ColumnName="OutTime" />
<ScalarProperty Name="SignInOutNotes" ColumnName="SignInOutNotes
<ScalarProperty Name="StudentName" ColumnName="StudentName" />
<ScalarProperty Name="TotalMinutes" ColumnName="TotalMinutes" />
<ScalarProperty Name="TotalTime" ColumnName="TotalTime" />
Also, my error message at this point, before I rebuild, reads:
"Error 1 Error 11009: Property 'utathleteinfoAthleteInfoA
Uid' is not mapped. Line: STT.edmx 138"
When I go to line 138 within the edmx file, the following line is found:
"<Property Type="Int32" Name="utathleteinfoAthlete
InfoAUid" Nullable="false" />"
Remember, this is before I rebuild, with the XML description of the model open. Once I rebuild, I get the same error as I initially described. In short my question is how do I solve this (these) errors?
CREATE TABLE `utathleteinfo` (
`AthleteInfoAUid` int(11) NOT NULL AUTO_INCREMENT,
`AthleteUid` varchar(8) NOT NULL,
`AthleteSSN` varchar(11) DEFAULT NULL,
PRIMARY KEY (`AthleteInfoAUid`),
UNIQUE KEY `AthleteUid_UNIQUE` (`AthleteUid`),
UNIQUE KEY `AthleteInfoAUid_UNIQUE` (`AthleteInfoAUid`),
UNIQUE KEY `AthleteSSN_UNIQUE` (`AthleteSSN`),
KEY `fk_utathleteinfo_utinout` (`AthleteUid`),
CONSTRAINT `fk_utathleteinfo_utinout` FOREIGN KEY (`AthleteUid`) REFERENCES `utinout` (`AthleteUid`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=570 DEFAULT CHARSET=latin1$$
REFERENCES `utinout` (`AthleteUid`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
, ADD INDEX `fk_utathleteinfo_utinout` (`AthleteUid` ASC);