Ok, this might be a noob question but I'm stumped. I have two tables one is a Comment table with an ID and the comments, the ID is an auto-increment column. The other table has the primary data and 6 columns that are a foriegn key to the Comment table. One column for the different comment types on the screen.
I am trying to figure out how to do this in a mapping file such that I can have the following class structure:
PrimaryClass
public int myId
public CommentClass GeneralCOmment { get ; set; }
public CommentClass SpecificComment { get; set; }
CommentClass
public int id
public string comment
The comment ID is specified in the table the Primary class is part of for each field. I was guessing I might be able to do a One-to-one mapping for each field but not sure. There is no comment types other than the column name being different. Assume we are unable to change the DB and that we would like to get all the data in one pass if possible.
Any help would be appreciated.
Thanks.
|