title: Hibernate sets null value for a column, instead of deleting the entire row on saveOrUpdate()
body: <p>I have a class CatastrophePerilAssoc that controls the mapping of a Catastrophe class to a Peril class, with a table CAT_PERIL_ASSOC that has three rows: id(primary key, auto-generated), catastrophe.id(mapped to a catastrophe), and peril.id(mapped to a peril)</p>
  
  <p>When I add or remove associations, new associations(rows) are created in the table, which is fine. However, hibernate does not delete the old rows, but instead sets the value of catastrophe.id to null.  Is there a way for me to tell hibernate to delete these rows instead?  Note that I don't want to delete the actual objects as they are being used elsewhere, but I just want to remove them from this particular table.</p>
  
  <p>Looking at the sql log, I can confirm that it is setting the column value to null:</p>
  
  <pre><code>update CAT_PERIL_ASSOC set CATASTROPHE_TYPE_ID=null where CATASTROPHE_TYPE_ID=?
  </code></pre>
  
  <p>Hbm file:</p>
  
  <pre><code>&lt;hibernate-mapping package="com.nature"&gt;
      &lt;class name="com.nature.CatastrophePerilAssoc" table="CAT_PERIL_ASSOC"&gt;
          &lt;id name="id" type="string"&gt;
              &lt;column name="id" length="32" /&gt;
              &lt;generator class="uuid.hex" /&gt;
          &lt;/id&gt;
          &lt;many-to-one name="catastrophe" class="com.nature.catastrophe"&gt;
                 &lt;column name="CATASTROPHE_TYPE_ID" /&gt;
           &lt;/many-to-one&gt;
           &lt;many-to-one name="peril" class="com.nature.peril"&gt;
                  &lt;column name="PERIL_ID" /&gt;
           &lt;/many-to-one&gt;
  
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Java class:</p>
  
  <pre><code>public class CatastrophePerilAssoc  {
  
      private Catastrophe cat; 
      private Peril peril;
  
      public Catastrophe getCatastrophe() {
          return cat;
      }
      public void setCatastrophe(Catastrophe cat) {
          this.cat = cat;
      }
  
      public Peril getPeril() {
          return peril;
      }
      public void setPeril(Peril peril) {
          this.peril = peril;
      }
  }
  </code></pre>
  
  <p>Code to update association:</p>
  
  <pre><code>public void saveCatPerilAssoc(Catastrophe cat) {
  
      Criteria polquery = getSession(false).createCriteria(cat.getClass());
      polquery.add(Restrictions.eq("name", cat.getName()).ignoreCase());
  
      if (cat.getId() != null) {
          polquery.add(Restrictions.ne("id", cat.getId()));
      }
  
      if (polquery.list().size() &gt; 0) {
          //throw error
      }
  
      getSession(false).saveOrUpdate(cat);
  }
  </code></pre>