开发者

DetachedCriteria equivalent needed

开发者_如何学运维

I need the DetachedCriteria equivalent to the following HQL:

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

Thanx


It's all depending of your Mapped objects

Here is an example:

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

Hope it helps

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜