Hi,
I want to map two columns (createdBy and modifiedBy - both the columns are foreign keys in PersonalDetails table and referenced with "userID" in 'User' table ) with the class "User" (PK: userID).
Foreign Keys:
CONSTRAINT FOREIGN KEY (`CreatedBy`) REFERENCES `User` (`UserID`), CONSTRAINT FOREIGN KEY (`ModifiedBy`) REFERENCES `User` (`UserID`),
I have written a many-to-one relation to map both the fields.
table: PersonalDetails
<many-to-one name="modifiedBy" class="com.User"> <column name="ModifiedBy" not-null="true" /> </many-to-one>
<many-to-one name="createdBy" class="com.User"> <column name="CreatedBy" not-null="true" /> </many-to-one>
while mapping like the above, am getting the following error
"An association from the table PersonalDetails refers to an unmapped class com.User"
Could you plz give me the solution to resolve this or do I need to change the hibernate mapping code?
|