【发布时间】:2012-12-06 21:06:17
【问题描述】:
SQL Server 语法是:
select tableAColumn1, tableAColumn2, tableBColumn1
from tableA, tableB
where ISNUMERIC(tableAColumn1) = 1
and CONVERT(INT, tableAColumn1) = tableBColumn1
and tableAColumn2 = 'something'
在 Fluent NHibernate 中实现这一目标的最佳方法是什么?我需要多少个类来帮助获得生成的 ClassMap?它是什么样子的?
编辑:
public class BarausInfoMap : ClassMap<BarausInfo>
{
public BarausInfoMap()
{
Table("BARAUS");
Id(x => x.nr);
Map(x => x.betrag);
Join("BARAUSLANG", m =>
{
m.Fetch.Join();
m.KeyColumn("Ula");
m.Map(x => x.bezeichnung);
m.Map(x => x.sprache);
m.Map(x => x.la);
this.Where("m.la = 'SPE'");
});
}
}
nr 列是 int 并且 ula 列是字符串,但我需要加入这 2 个。另外,this.where 是指我猜的外部表,但它应该指的是内部表。
【问题讨论】:
-
你能展示你到目前为止所做的事情吗?
-
确定没问题添加到原帖
标签: nhibernate join where fluent