Im working with Nhibernate 3.0 and have problem with QueryOver collection. I have entities
Order{
List<Item> items;
}
Item
{
Product product;
}
Product
{
String name;
}
Relation between Order and Item is one-to-many. I want to get list of all orders having product with given name using QueryOver< Order> Equivalent of sql:
Select DISTINCT or.* From [Order] or
LEFT JOIN Item it on it.OrderId=or.OrderId
LEFT JOIN Product pr on pr.ProductId=it.ProductId
WHERE p.Name ='NameToSearch'