Thank you! That was exactly what I needed.

On Friday, February 22, 2013 4:21:13 AM UTC-6, Marcello Esposito wrote:
>
> Maybe something like
>
> CommunicationMaster master = null;
> CommunicationDetail detail = null;
> Staff staff = null;
>            
>             session
>                 .QueryOver<CommunicationMaster>(() => master)
>                 .JoinAlias(x => x.Detail, () => detail, 
> NHibernate.SqlCommand.JoinType.InnerJoin)
>                 .JoinAlias(x => x.Staff, () => staff, 
> NHibernate.SqlCommand.JoinType.RightOuterJoin)
>                 .WhereRestrictionOn(() => 
> master.Created_Date).IsBetween(dateMin, dateMax)
>                 .And(() => detail.StaffId == staffId)
>                 .AndRestrictionOn(() => detail.IsArchived).IsNull
>                 ....
>
> Cheers,
> Marcello.
>
> Il giorno giovedì 21 febbraio 2013 20:22:40 UTC+1, Phong Lo ha scritto:
>>
>> Hello al, I'm new to the NHibernate world and am trying to convert the 
>> following sql statement to QueryOver. I've not had much success using 
>> google to find what i need. Here is the statement. Thanks in advance.
>>
>> select
>>
>>         CommunicationMaster.CommunicationID as CommunicationID,
>>
>>        Staff.StaffID as StaffID,
>>
>>         CommunicationDetail.Status as Status
>>
>>        from
>>
>>         dbo.[shr_PC_Communication] CommunicationMaster 
>>
>>     inner join
>>
>>         dbo.[shr_PC_Communication_Detail] CommunicationDetail 
>>
>>             on 
>> CommunicationMaster.CommunicationID=CommunicationDetail.CommunicationID 
>>
>>     left outer join
>>
>>         dbo.[shr_Staffs] Staff 
>>
>>             on CommunicationDetail.StaffID=Staff.StaffID 
>>
>>          where
>>
>>         (
>>
>>             CommunicationMaster.Created_Date between @p0 and @p1
>>
>>         ) 
>>
>>         and (
>>
>>             CommunicationMaster.IsRemoved is null
>>
>>         ) 
>>
>>         
>>
>>         and (
>>
>>             CommunicationDetail.IsArchived is null
>>
>>         ) 
>>
>>         and (
>>
>>             CommunicationDetail.Status in (
>>
>>                 @p3
>>
>>             )
>>
>>         ) 
>>
>>         and (
>>
>>             Staff.StaffID in (
>>
>>                 @p4
>>
>>             )
>>
>>         );
>>
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to