I have a question about hql language. I'm trying to generate DTO's via hql syntax on my WCF REST application. I have a problem with the second query. What is wrong with it? Is there any other way to reach the same result?
This works good.
session.CreateQuery(@"select new EntityTypeDTO(t.ID, t.Title, assc.ID)
from crmEntityType t
left outer join t.Association as assc").List<EntityTypeDTO>();
This does not work.
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>();