I had this QueryOver query:
var result = session.QueryOver<TopicSelection>()
.Where(x => x.LacId == lac && x.RemoveDate == null)
.List();
In a nutshell: TopicSelection is a base class, and one subclass has many-to-one property, with lazy=false and fetch=join.
When I used QueryOver, NHibernate created nice join and fetched additional data from many-to-one table. Which is great, one query is issued and I get everything.
When I changed it to LINQ to NHibernate:
var result = session.Query<TopicSelection>()
.Where(x => x.LacId == lac && x.RemoveDate == null)
.ToList();
executed query does not contain JOIN. What is more, every time a many-to-one property is needed, an additional select is issued.
Is is a bug in LINQ in NHibernate? Can I instruct LINQ to NHibernate query to fetch data for subclass?