A simple query like the following throws an exception:
var result = session.Query<Entity1>()
.Where(x => x.Name == "Something")
.SelectMany(x => x.Entity2s)
.Where(x => x.Category == "Anything")
The exception is: "QueryException : could not resolve property: Name of: Entity2"
NHibernate is searching the "Name" property in the "Entity2" class although it only exists in the "Entity1" class.
Renaming the "x" in any of the where clauses to anything different makes the query work.