NHibernate Version: 2.0.1GAHello,
I'm wondering if anyone could help me with the following scenario. I have a Employee class that has the following definition:
Code:
public class Employee
{
public Employee ReportsTo { get; set; }
public string Name { get; set; }
public string Role { get; set; }
}
And the following employee structure:
Code:
Name: John Doe Role: President
`- Name: Jane Doe Role: Vice President
`- Name: Simon Role: Managing Director
`- Name: Bob Role: Sales Manager
`- Name: Michael Role: Sales Rep
`- Name: Ruth Role: Product Manager
I would like to create a criteria where I could pass the Employee object for
John Doe (President) and retrieve all the Employees including
Michael (Sales Rep).
Or in the event that I pass the Employee object for
Jane Doe (Vice President) that I retrieve all the Employees excluding
John Doe (President).
Any suggestions? Possible using ICriteria?
(I'm looking for suggestions, I do not have an hbm created)
Cheers,
Timothy Grant Vogelsang