I have an Entity which holds a collection of OtherEntity in a many-to-many style relationship. The mapping for this property looks like:
HasManyToMany(x => x.OtherEntity)
.AsBag()
.Table("EntityToOtherEntityMapping")
.ParentKeyColumn("EntityId")
.ChildKeyColumn("OtherEntityId")
.Not.LazyLoad()
.Cascade.None();
I notice that when retrieving a collection of Entity's there's a seperate SQL query for each collection of OtherEntity.
How can I have Fluent-NHibernate execute this retrieval in one query rather than n?