任何人都有任何想法为什么这个查询不会得到正确的加载? (Finan急切地加载,但Trans / Charge / Purchaser不是。
return session.QueryOver<Plot>()
.Where(x => x.Project == Project)
.Fetch(x => x.Trans).Eager
.Fetch(x => x.Charge).Eager
.Fetch(x => x.Finan).Eager
.Fetch(x => x.Purchaser1.User).Eager
.Future<Plot>();
我的映射:
public class PlotMappingOverride : IAutoMappingOverride<Plot>
{
public void Override(AutoMapping<Plot> mapping)
{
mapping.References(x => x.Project).Cascade.SaveUpdate().Not.LazyLoad().Not.Nullable();
mapping.References(x => x.Finan).Cascade.SaveUpdate();
}
}
编辑:我的剧情类如下所示:
[Serializable]
public class Plot : BaseEntity<Plot>
{
public virtual Project Project { get; set; }
public virtual string Plot_No { get; set; }
public virtual PlotPurchaser Purchaser1 { get; set; }
public virtual Finan Finan { get; set; }
public virtual Trans Trans{ get; set; }
public virtual Charge Charge{ get; set; }