I am trying to use ICriteria to create a query that has a join
condition. The SQL I am trying to generate should look like this

SELECT c.ClientID
FROM Client c
LEFT OUTER JOIN ClientContact t on c.ClientID = t.ClientID AND
t.ContactType = 'Email'

If I use a criteria like

m_ClientRepository.QueryAlias("client")
      .CreateCriteria("client.Contacts", "c", JoinType.LeftOuterJoin)
      .Add(Restrictions.Eq("c.ContactType", ContactType.Email));

It will generate the sql below which I don't want.

SELECT c.ClientID
FROM Client c
LEFT OUTER JOIN ClientContact t on c.ClientID = t.ClientID
WHERE t.ContactType = 'Email'

Is there anyway to do this with ICriteria or HQL if ICriteria is not possible ?

Craig

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to