title: Help with NHibernate Insert/Update
body: <p>I am new to <a href="http://en.wikipedia.org/wiki/NHibernate" rel="nofollow noreferrer">NHibernate</a> and have found it extremely interesting. I have been trying to persist objects to a mapping table (the table that breaks a many to many relations in the relational database design) but not been able to do so so far. I am able to retrieve data from the mapping table using my current hibernate-mapping, though.</p>
  
  <p>Here is what my database looks like:</p>
  
  <p>Groups (groupId, groupName)
  Reports (reportID, reportName)
  GroupReports(groupId, reportId)</p>
  
  <p>Very typical and simple relations in terms of data modeling.</p>
  
  <p>I know this question has been asked many times and I have read lots of them. Believe me, I really did.</p>
  
  <p>Here is my mapping for the Group entity class:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataTransfer" namespace="DataTransfer"&gt;
    &lt;class name="DataTransfer.Group, DataTransfer" table="GROUPS"&gt;
      &lt;id name="GroupId"&gt;
        &lt;column name="groupId" sql-type="int" not-null="true"/&gt;
        &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;property name="GroupName" column="groupName" type ="string" length="150" not-null="true"/&gt;       
      &lt;bag name="Reports" cascade="none" inverse="true"&gt;
        &lt;key column="groupId"/&gt;
        &lt;many-to-many column="reportId" class="DataTransfer.Report, DataTransfer"/&gt;      
      &lt;/bag&gt;
    &lt;/class&gt;
   &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>And my mapping for the Report entity class likes below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataTransfer" namespace="DataTransfer"&gt;
    &lt;class name="DataTransfer.Report, DataTransfer"  table="REPORTS" &gt;
      &lt;id name="ReportId" column="reportId" type="int" unsaved-value="0"&gt;
        &lt;generator class="native"/&gt;
      &lt;/id&gt;        
      &lt;property name = "ReportName" column="reportName" type="string" length="250" not-null="true"/&gt;
      &lt;bag name="MappedGroups" table="GroupReports" cascade="all" inverse="false" lazy="true"&gt;
        &lt;key column="reportId"/&gt;
        &lt;many-to-many class="DataTransfer.Group, DataTransfer" column="groupId" /&gt;          
      &lt;/bag&gt;    
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>According to what I have read, these mappings should allow me to both retrieve and persist the mapping data from the associate table GroupReports. My unit test code reveals only select SQL statement, no inserts to the mapping table.</p>
  
  <p>Given my mappings, what should do to persist the mapping data?</p>