1
我需要的DetachedCriteria等同於以下HQL:的DetachedCriteria相當於需要
select obj
from Objects obj, Text text
where obj.TextId = text.TextId and <Some_Other_Condition>
order by text.Value
感謝名單
我需要的DetachedCriteria等同於以下HQL:的DetachedCriteria相當於需要
select obj
from Objects obj, Text text
where obj.TextId = text.TextId and <Some_Other_Condition>
order by text.Value
感謝名單
這一切都取決於你的映射對象
這裏有一個例子:
var criteriaObject = DetachedCriteria.For(typeof(Objects))
.CreateAlias("TextReference", "text")
.Add(Restrictions.Eq("Activate", true))
.AddOrder(new Order("text.Value", true));
希望它有幫助