以下のクエリのような結果を得るためにマップを作成しようとしています。where条件のように、Product_Lineへの参照を3列に設定するように製品マッピングを設定するのに苦労しています。流暢を使用してこれを達成するにはどうすればよいですか?
Product テーブル: cId、ProjID、Line など、列 Product_Line テーブル: cId、ProjID、Line など、列
select f.* from Product f join Product_Line v on f.cId = v.CId and f.ProjID = v.ProjID and f.line = v.line
前もって感謝します。RajeshC
まず、調査していただきありがとうございます。ここに詳細情報を記載してください: //Req: ProductLine がない場合は ProductLine を作成し、ProductLine がある場合は更新するように製品を照会したい.
public class ProductMap : ClassMap<Product>
{
Id(x => x.Id);
Map(x => x.CustomerId, "CustId");
Map(x => x.ProjId, "PROJId");
Map(x => x.LineNumber, "LineNumber");
Map(x => x.ReportType, "ReportType");
// Reference to Product_Line? - this reference should be based on three columns (custId, ProjId, LineNumber)
References(x => x.Line);
}
public class ProductLineMap : ClassMap<ProductLine>
{
Table("Product_Line");
Map(x => x.CustomerId, "CustId"); //same column as Product.CustId
Map(x => x.ProjId, "PROJId"); //Same as Product.ProjId
Map(x => x.LineNumber, "LINENUMBER"); //Same as Product.LineNumber
//etc.,
//for me, this reference is not needed as I need from Product to ProductLine - one way.
//References(x => x.Product).Column("ProjId") //
}