This is part of a series of posts about NHibernate Pitfalls. See the entire collection here.
When using the QueryOver API, unlike LINQ, when applying restrictions, you only have access to direct properties of the target entity type. If you need to access deeper nested properties – those from associated entities – you have to explicitly join. This does not apply to the property representing the foreign key, however. Let’s see an example:
In general, the QueryOver API is more complex to use than the LINQ one, the advantage is that it allows better composition of dynamic queries.