title: NHibernate collections: many-to-many relationships
body: <p>I've got two models, a Product model and a ShoppingCart model. The ShoppingCart model has a collection of products as a property called Products (List). Here is the mapping for my ShoppingCart model.</p>
  
  <pre><code>&lt;class name="MyProject.ShoppingCart, MyProject" table="ShoppingCarts"&gt;
    &lt;id name="Id" column="Id"&gt;
      &lt;generator class="native" /&gt;
    &lt;/id&gt;
  
    &lt;many-to-one name="Company" class="MyProject.Company, MyProject" column="CompanyId" /&gt;
    &lt;property name="ExternalId" column="GUID" generated="insert" /&gt;
    &lt;property name="Name" column="Name" /&gt;
    &lt;property name="Total" column="Total" /&gt;
    &lt;property name="CreationDate" column="CreationDate" generated="insert" /&gt;
    &lt;property name="UpdatedDate" column="UpdatedDate" generated="always" /&gt;
  
    &lt;bag name="Products" table="ShoppingCartContents" lazy="false"&gt;
      &lt;key column="ShoppingCartId" /&gt;
      &lt;many-to-many column="ProductId" class="MyProjectMyProject.Product, MyProject" fetch="join" /&gt;
    &lt;/bag&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p>When I try to save to the DB, the ShoppingCart is saved, but the mapping rows in ShoppingCartContents aren't save, making me thing that there's an issue with the mapping. Where am I going wrong here?</p>