Write subquery in Criteria of nHibernate.

Posted by Bipul on Stack Overflow See other posts from Stack Overflow or by Bipul
Published on 2010-05-06T07:09:02Z Indexed on 2010/05/06 8:18 UTC
Read the original article Hit count: 355

Filed under:
|
|

I read about subquery in Criteria, but I am still unable to grasp it properly. So, here I am taking one example and if somebody can help me writing that using subquery it will be great.

Lets say we have table

Employee{EmployeeId.(int),Name(string),Post(string),No_Of_years_working(int)}

Now I want all the employees who are Managers and working for less than 10 years. I know that we can get the result without using subqueries but I wanna use subquery just to understand how it works in criteria. So, how I can write Criteria using subquery to get those employees.

Thanks

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about criteria