任何人都可以帮我如何执行下面的nhibernate标准,以便Process类按SourceSystem.Name排序。
public abstract class Process : DomainObject<int>
{
public virtual IList<Paramater> Parameters { get; set; }
}
public class Paramater : DomainObject<int>
{
public virtual SourceSystem SourceSystem { get; set; }
}
public class SourceSystem : DomainObject<int>
{
public virtual string Name { get; set; }
}
process = _session
.CreateCriteria<Process>()
.Add(Restrictions.Eq("Id", loadingProcessId))
.UniqueResult<Process>();
由于
答案 0 :(得分:0)
process = _session.CreateCriteria<Process>()
.Add(Restrictions.Eq("Id", loadingProcessId))
.CreateCrtieria("Parameters")
.CreateCrtieria("SourceSystem", "SourceSystem")
.AddOrder(Order.Asc("SourceSystem.Name"))
.UniqueResult<Process>();