title: Cascade ="all" not saving child entities
body: <p>I <em>think</em> the object model below is saying a Party and PartyName to have a many to one relatioship. An I think the cascade=all i the Party.hbm sshould be having NHib save the child PartyName(s).</p>
  
  <p>But it clearly isn't...</p>
  
  <p>Can someone explain why PartyName isn't being saved with Party and what to do to fix?</p>
  
  <p>Cheers,<br>
  Berryl</p>
  
  <p><img src="https://i.stack.imgur.com/pOu3P.png" alt="enter image description here"></p>
  
  <h1>MAPPING</h1>
  
  <pre><code>&lt;class name="Party" table="Parties"&gt;
  &lt;id name="Id"&gt;
    &lt;column name="PartyId" /&gt;
    &lt;generator class="hilo" /&gt;
  &lt;/id&gt;
  
  &lt;discriminator column="Type" not-null="true" type="string" /&gt;
  
  &lt;set access="field.camelcase-underscore" cascade="all" inverse="true" name="Names"&gt;
    &lt;key foreign-key="Party_PartyName_FK"&gt;
      &lt;column name="PartyNameId" /&gt;
    &lt;/key&gt;
    &lt;one-to-many class="Parties.Domain.Names.PartyName, Parties.Domain" /&gt;
  &lt;/set&gt;
  
  &lt;subclass 
    name="Smack.Core.TestingSupport.NHibernate.TestableDomain.SomeDopeyDomainModel.Student, Smack.Core.TestingSupport" 
    discriminator-value="Student"
    &gt;
    &lt;property name="Number" /&gt;
  
    &lt;many-to-one 
      class="Smack.Core.TestingSupport.NHibernate.TestableDomain.SomeDopeyDomainModel.Course, Smack.Core.TestingSupport" 
      foreign-key="Course_FK" 
      name="Course"&gt;
      &lt;column name="CourseId" index="CourseIndex" /&gt;
    &lt;/many-to-one&gt;
  &lt;/subclass&gt;
  </code></pre>
  
  <p>
      
      
        
        
      </p>
  
  <pre><code>&lt;many-to-one access="field.camelcase-underscore" class="Parties.Domain.Party" foreign-key="Party_FK" name="Party"&gt;
    &lt;column name="PartyId" index="PartyIndex" not-null="true"/&gt;
  &lt;/many-to-one&gt;
  &lt;property name="TheRequiredName" not-null="true" length="50"/&gt;
  &lt;property name="EverythingElse" /&gt;
  &lt;property name="ContextUsed" length="50"/&gt;
  &lt;property name="Salutation" length="20"/&gt;
  &lt;property name="EffectivePeriod" type="Smack.Core.Data.NHibernate.UserTypes.DateRangeUserType, Smack.Core.Data"&gt;
    &lt;column name="EffectiveStart"/&gt;
    &lt;column name="EffectiveEnd"/&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p></p>
  
  <h1>Failing Test (and output)</h1>
  
  <pre><code>    [Test]
      public void CanSaveAndLoad_AllProperties()
      {
          var partyName = NameSeeds.DevName;
          partyName.Party = _party;
          Assert.That(_party.Names.First(), Is.EqualTo(partyName));
  
  
          using (var tx = _session.BeginTransaction())
          {
              _session.Save(_party);
              tx.Commit();
          }
          _session.Clear();
  
          Party foundParty;
          using (var tx = _session.BeginTransaction())
          {
              foundParty = _session.Get&lt;Party&gt;(_party.Id); *** &lt;=== name s/b saved!!
              tx.Commit();
          }
          PartyName foundName = foundParty.Names.First();
          //found.Look();
  
          Assert.That(foundName, Is.EqualTo(partyName));
          Assert.That(foundName.Party, Is.Not.Null);
          Assert.That(foundName.TheRequiredName, Is.EqualTo(partyName.TheRequiredName));
          Assert.That(foundName.EverythingElse, Is.EqualTo(partyName.EverythingElse));
          Assert.That(foundName.ContextUsed, Is.EqualTo(partyName.ContextUsed));
          Assert.That(foundName.Salutation, Is.EqualTo(partyName.Salutation));
          Assert.That(foundName.EffectivePeriod, Is.EqualTo(partyName.EffectivePeriod));
      }
  
  
  NHibernate: INSERT INTO Parties (Type, PartyId) VALUES ('Parties.Domain.Party', @p0);@p0 = 32768 [Type: Int32 (0)]
  NHibernate: SELECT party0_.PartyId as PartyId2_0_, party0_.Number as Number2_0_, party0_.CourseId as CourseId2_0_, party0_.Type as Type2_0_ FROM Parties party0_ WHERE party0_.PartyId=@p0;@p0 = 32768 [Type: Int32 (0)]
  </code></pre>