0

谁能帮助我如何执行以下休眠条件,以便 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>();

谢谢

4

1 回答 1

0
process  = _session.CreateCriteria<Process>()
    .Add(Restrictions.Eq("Id", loadingProcessId))
    .CreateCrtieria("Parameters")
    .CreateCrtieria("SourceSystem", "SourceSystem")
    .AddOrder(Order.Asc("SourceSystem.Name"))
    .UniqueResult<Process>();
于 2012-11-02T15:16:04.813 回答