title: Why is a field in my Hibernate entity null?
body: <p>I added a new integer column to a table in my MSSQL database, and then updated the .hbm.xml and .java files accordingly for the Hibernate entity of this table. I can see that I have assigned a '1' to the column for a given row that I'm working with, yet the entity I am getting back for this row has a null value in its field.</p>
  
  <p>What seems even more strange is that, upon inspecting the usage of the getter and setter for this field by using breakpoints, they appear to be taking in and sending out a 1 when expected... though the boolean helper method I created (to return false if the value is 0 and true if 1), is seeing the field as null and is throwing an exception. This is happening even after the setter is called on the entity.</p>
  
  <p>Any ideas of why this is happening? I'm only very mildly familiar with Hibernate, but I suspect that it's not a lazy loading issue since this is an integer type, not another entity altogether.</p>
  
  <h2>Edit</h2>
  
  <p>Here's the relevant parts of my Hibernate files. I can't include much due to confidentiality reasons, but this should be generic enough.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
      &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
      &lt;!-- Generated 8-Sep-2011 3:31:37 PM by Hibernate Tools 3.2.4.GA --&gt;
      &lt;hibernate-mapping&gt;
              &lt;class name="net.company.EntityName" table="TableName" schema="dbo" catalog="database"&gt;
                  &lt;id name="id" type="int"&gt;
                      &lt;column name="TableNameId" /&gt;
                      &lt;generator class="identity" /&gt;
                  &lt;/id&gt;
                      ...
                  &lt;property name="cancelled" type="int"&gt;
                      &lt;column name="Cancelled" /&gt;
                  &lt;/property&gt;
                  &lt;property name="cancelledOn" type="timestamp"&gt;
                      &lt;column name="CancelledOn" length="23" /&gt;
                  &lt;/property&gt;
                  &lt;property name="cancelledBy" type="string"&gt;
                      &lt;column name="CancelledBy" length="50" /&gt;
                  &lt;/property&gt;
                      ...
              &lt;/class&gt;
      &lt;/hibernate-mapping&gt;
  
  
      public Integer getCancelled() {
          return cancelled;
      }
  
      public void setCancelled(Integer cancelled) {
          this.cancelled = cancelled;
      }
  
      public boolean isCancelled() {
          return cancelled != null &amp;&amp; cancelled == 1;
      }
  
      public Date getCancelledOn() {
          return cancelledOn;
      }
  
      public void setCancelledOn(Date cancelledOn) {
          this.cancelledOn = cancelledOn;
      }
  
      public void setCancelledBy(String cancelledBy) {
          this.cancelledBy = cancelledBy;
      }
  
      public String getCancelledBy() {
          return cancelledBy;
      }
  </code></pre>
  
  <p>I thought that it may possibly be because of improper Dozer behavior, but the following is the only mapping in the dozer-mappings.xml file relevant to this entity:</p>
  
  <pre><code>&lt;mapping&gt;
      &lt;class-a&gt;net.company.EntityName&lt;/class-a&gt;
      &lt;class-b&gt;net.company.EntityName&lt;/class-b&gt;
  &lt;/mapping&gt;
  </code></pre>