Reformulate with-clause

This should fix https://bugzilla.redhat.com/show_bug.cgi?id=953195. The fix idea came from http://stackoverflow.com/questions/4467722/nhibernate-hql-left-outer-join-with-with-clause-does-not-work