0
我有一個關於hql語言的問題。我試圖在我的WCF REST應用程序上通過hql語法生成DTO。我對第二個查詢有問題。它有什麼問題?有沒有其他方法可以達到相同的結果?在hql查詢中選擇多個new()對象
這很好。
session.CreateQuery(@"select new EntityTypeDTO(t.ID, t.Title, assc.ID)
from crmEntityType t
left outer join t.Association as assc").List<EntityTypeDTO>();
這是行不通的。
session.CreateQuery(@"select new EntityTypeDTO(t.ID, t.Title, assc.ID, new CustomFieldDTO(f.ID,f.EntityType,f.FieldType,f.Name,f.Value))
from crmEntityType t
join fetch t.Fields as f
left outer join t.Association as assc").List<EntityTypeDTO>();