1

我需要与以下 HQL 等效的 DetachedCriteria:

select obj
from Objects obj, Text text
where obj.TextId = text.TextId and <Some_Other_Condition>
order by text.Value

谢谢

4

1 回答 1

0

这完全取决于您的映射对象

这是一个例子:

    var criteriaObject = DetachedCriteria.For(typeof(Objects))
        .CreateAlias("TextReference", "text")
        .Add(Restrictions.Eq("Activate", true))
        .AddOrder(new Order("text.Value", true));

希望能帮助到你

于 2011-02-17T14:59:07.337 回答