【发布时间】:2011-08-09 19:47:32
【问题描述】:
嗨 如何对同一张表使用 queryover (Join)...示例
if (!string.IsNullOrEmpty(ufResidencia))
{
EnderecoProspect endProspectRes =null;
TipoEndereco tipoEndProspectRes = null;
query
.JoinQueryOver<EnderecoProspect>(x => x.Enderecos, () => endProspectRes)
.And(() => endProspectRes.Uf == ufResidencia)
.JoinQueryOver<TipoEndereco>(x => x.TipoEndereco, () => tipoEndProspectRes)
.And(() => tipoEndProspectRes.Descricao != "Fazenda");
}
if (!string.IsNullOrEmpty(ufFazenda))
{
EnderecoProspect endProspectFaz = null;
TipoEndereco tipoEndProspectFaz = null;
query
.JoinQueryOver<EnderecoProspect>(x => x.Enderecos, () => endProspectFaz)
.And(() => endProspectFaz.Uf == ufFazenda)
.JoinQueryOver<TipoEndereco>(x => x.TipoEndereco, () => tipoEndProspectFaz)
.And(() => tipoEndProspectFaz.Descricao == "Fazenda");
}
当我尝试运行时,我收到路径重复的消息。
【问题讨论】:
标签: nhibernate fluent-nhibernate queryover