There are two things to be mentioned.
Firstly, Many-to-many is represented by pairing table, with two columns. These are playing role parent-child and child-parent.
Secondly, one end must be marked as inverse. Below the Items are marked .Inverse()
There is an example of the Item
mapping
public class ItemMap : ClassMap<Item>
{
public LibraryMap()
{
// table, id, other properties
...
HasManyToMany(x => x.Ranges)
.Table("itr_RangeItemsAssoc")
.ParentKeyColumn("itr_ItemRangeKey") // not itm_Key
.ChildKeyColumn("itr_ItemsKey")
.Cascade.SaveUpdate()
.LazyLoad();
The similar for a Range
HasManyToMany(x => x.Items)
.Table("itr_RangeItemsAssoc")
.ParentKeyColumn("itr_ItemsKey") // not itr_Key
.ChildKeyColumn("itr_ItemRangeKey")
.Cascade.SaveUpdate()
.LazyLoad()
// here, the inverse
.Inverse() // one end must be marked as inverse
;
Here you can get some idea about the mapping behind: 6.8. Bidirectional Associations
The example of the fluent mapping many-to-many could be found here: Mapping-by-Code - OneToMany and other collection-based relation types (the second half of the article)