I have the following mapping override on one side of the relationship:
public void Override(AutoMapping<ItemAsmtDetailDh> mapping)
{
mapping.HasMany<WAsmtDetail>(x => x.WAsmtDetails).Inverse().AsBag().Cascade.AllDeleteOrphan().Access.PascalCaseField(Prefix.Underscore).Not.LazyLoad().Fetch.Join();
}
and on the other side of the relationship I have:
public void Override(AutoMapping<WAsmtDetail> mapping)
{
mapping.References<ItemAsmtDetailDh>(x => x.ItemAsmtDetailDh).Not.Nullable().Not.LazyLoad().Fetch.Join();
}
When I use the ShowSql option I see that it's still issuing separate select statements for the WAsmtDetails giving me the dreaded "n + 1 selects" problem. Why is ".Not.LazyLoad().Fetch.Join()" being ignored?
Note: I'm using Fluent NHibernate version 1.1, not version 2.1, because of a bug in the newer version. (See my answer for this question for bug details.) I'm using NHibernate version 2.1.2.4000.