Hi,
I'm really new to NHibernate and I'm allocated to a project using Flex, .Net and NHibernate. The custom company framework for NHibernate has a lot of methods and filters, all basic commands to help on developing, but I need to create a more complicated query, joining a lot of tables and returning a list of a non mapped properties, one from each table, result of the query.
I don't know if it's a concept error, considering that I'm not used to OO databases or it's lack of information on internet. I have the SQL query and I don't have any idea on how to execute it. I got some examples using NHibernate inner joins, but they consider only one relationship.
Code:
select rc.CurrentDate, re.ResourceId,re.Name,ro.Description,rc.Cost, sa.Description, rst.Description,sk.Description
from UserRole ur
inner join Role ro on ro.RoleId=ur.RoleID
inner join SystemUser su on su.SystemUserId=ur.SystemUserID
inner join Resource re on re.SystemUserId=su.SystemUserId
inner join ResourceSkill rs on rs.ResourceId=re.ResourceId
inner join Skill sk on sk.SkillId=rs.SkillId
inner join ResourceStatus rst on rst.ResourceStatusId=re.ResourceStatusId
inner join ResourceCost rc on rc.ResourceId=re.ResourceId
inner join SubArea sa on sa.SubAreaId = re.SubAreaId
where rc.CurrentDate=(Select MAX(CurrentDate) from ResourceCost where ResourceId=re.ResourceId)
and ro.RoleId=1 and sk.SkillId=3
Any ideas would be helpful.
Thanks in advance!