1
我有這個類:的NHibernate:規格化SQL查詢映射到一個對象
public Customer
{
public int CustomerId {get;set;}
....
public List<Order> OrderList {get;set;}
}
我想寫使用NHibernate CreateSQLQuery
SELECT C.CustomerId, .... O.OrderId, O.OrderDate, O.OrderTotal.....
FROM Customers C
LEFT OUTER JOIN Orders O ON C.CustomerID = O.CustomerID
如何使這種轉變工作這個SQL查詢:
.SetResultTransformer(Transformers.AliasToBean<Customer>())
並讓它包含每個Customer對象內的Orders列表?
感謝