Here is a draft of the solution... First the subquery:
var subquery = QueryOver
.Of<Tag>()
.Where(t => t.TagCategory == "Jobtype")
.Select(t => t.Name);
And now, we will use the subquery in the withClause
:
JobEmployee jobEmployee = null;
Location loc = null;
JobTag jobTag = null;
var list = session
.QueryOver<Job>()
.JoinAlias(x => x.location, () => loc)
.JoinAlias(x => x.tags, () => jobTag, JoinType.LeftOuterJoin,
// instead of this
// Restrictions.On(jobTag.name).IsIn(<subquery>))
// use this
Subqueries.WhereProperty(() => jobTag.name).In(subquery)
)
.List();
So, we filtered the JOIN using the withClause and Subqueries