Using NHibernate for .NET I have 3 tables. One is CourseType
, the other is Contact
and the last being a composite called CourseType_Contact
the composite table looks like this...
CourseTypeID Guid, ContactID Guid
I am attempting to use HQL to write a query that will retrieve all the Contacts
for a specific coursetype but I'm lost as to how to do this in HQL.
In SQL my query would look like this.
SELECT * FROM Contact WHERE ContactID IN(
SELECT ContactID FROM CourseType_Contact WHERE CourseTypeID = @CourseTypeID)
Could anyone point me in the right direction?