Let's say I have the following tables:
Task Table
-----------
Id [Guid]
Name [nvarchar(64)]
ParentId [Guid]
Time Entry Table
-----------------
Id [Guid]
EntryDate [DateTime]
HoursCharged [float]
TaskId [Guid]
For retrieiving a hierarchy in a single sql exec, I know that the
following works with the appropriate mappings setup:
public IList<Task> GetAggregateByParentId(Guid itemId)
{
string sql = "from Task e" +
" left join fetch e.Parent p" +
" left join fetch e.Children c" +
" where e.ParentId = :id";
var taskList = Session.CreateQuery(sql)
.SetGuid("id", itemId)
.List<Task>();
return taskList;
}
I would like to be able to also load the total time charged to the
activity.
Is this possible in the same sql call?
How would I do it?
Best Regards,
Eric
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.