DetachedCriteria equivalent needed

132 views Asked by At

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

1

There are 1 answers

0
alexl On BEST ANSWER

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