title: Hibernate: unmapped class association exception
body: <p>I know this should be a pretty elementary issue to fix, but 1) I'm relatively new to Hibernate, and 2) the fixes I've found don't (seem to) apply here.</p>
  
  <p>Here is the exception I am getting:</p>
  
  <pre>org.hibernate.MappingException: An association from the table POSTS refers to
   an unmapped class: com.beans.User at 
   org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1285)</pre>
  
  <p>This occurs when Hibernate attempts to configure itself.</p>
  
  <p>The objects I'm working with are Users, Posts (abstract superclass), Statuses and Comments (concrete subclasses of Post). Each is bean from one of two tables: USERS and POSTS. The User objects are pretty vanilla: lots of bland fields describing the user. In addition to similarly boring fields, a Status and a Comment both have owners (User that posted it). What differentiates a Status from a Comment is that a Status can have a list of Comments attached to it but no parent, while a Comment has no children posts, but has a parent (yes, this is basically Facebook).</p>
  
  <p>From what I've read, the problem seems to be in the many-to-one mappings, but I can't seem to find anything wrong. Here are the three configuration files I'm using.</p>
  
  <p>hibernate.cfg.xml:</p>
  
  <pre>
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          ...
          &lt;!-- mapped persistence classes --&gt;
          &lt;mapping resource="User.hbm.xml" /&gt;
          &lt;mapping resource="Post.hbm.xml" /&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;</pre>
  
  <p>User.hbm.xml:</p>
  
  <pre>
  &lt;hibernate-mapping&gt;
      &lt;class name="com.beans.User" entity-name="User" table="USERS" proxy="User"&gt;
          &lt;id name="uid" type="java.lang.Integer"&gt;
              &lt;column name="uid" /&gt;
              &lt;generator class="assigned" /&gt;
          &lt;/id&gt;
          ...
      &lt;/class&gt;
  &lt/hibernate-mapping&gt;</pre>
  
  <p>Post.hbm.xml:</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
      &lt;class name="com.beans.Post" entity-name="Post" table="POSTS" proxy="Post" abstract="true"&gt;
          &lt;id name="pid" type="java.lang.Integer"&gt;
              &lt;column name="pid" /&gt;
              &lt;generator class="assigned" /&gt;
          &lt;/id&gt;            
          &lt;discriminator column="type" /&gt;
          &lt;one-to-one name="parent" class="com.beans.Post"&gt;&lt;/one-to-one&gt;
          &lt;many-to-one name="owner" class="com.beans.User" update="false" fetch="select"&gt;
              &lt;column name="owner" /&gt;
          &lt;/many-to-one&gt;
          &lt;property name="postDate" type="java.sql.Timestamp" update="false"&gt;
              &lt;column name="post_date" /&gt;
          &lt;/property&gt;
          &lt;property name="content" type="java.lang.String" update="false"&gt;
          &lt;column name="content" /&gt;
          &lt;/property&gt;
          &lt;property name="type" type="string" update="false"&gt;
           &lt;column name="type" /&gt;
          &lt;/property&gt;
  
          &lt;subclass name="com.beans.Status" discriminator-value="status"&gt;
           &lt;list name="children" inverse="false" table="POSTS" lazy="true"&gt;
                  &lt;key column="pid" /&gt;
               &lt;index /&gt;
               &lt;one-to-many class="com.beans.Comment" /&gt;
       &lt;/list&gt;
          &lt;/subclass&gt;
  
          &lt;subclass name="com.beans.Comment" discriminator-value="comment"&gt;&lt;/subclass&gt; 
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>I get the feeling I need to specify somewhere the fact that a Status contains an ArrayList of Comment's, but isn't that done implicitly through the "list" construct in the Post.hbm.xml file?</p>
  
  <p>The xml files exist in my classpath (WEB-INF/classes), and the .java files themselves are visible to the application as well.  Insights would be appreciated!</p>