title: Hibernate : @SecondaryTable doesn't work
body: <p>I know, <code>@SecondaryTable</code> issues were published numerous times, so, if there is the same one (I haven't found it yet), please, give me the link or an advice. </p>
  
  <p>I have two tables in my database (<code>firstTable</code> and <code>secondTable</code>), two POJO Hibernate classes (<code>FirstTablePojo</code> and <code>SecondTablePojo</code>).  </p>
  
  <pre><code>+----------+             +-----------+
  |firstTable|             |secondTable|
  |----------+             |-----------+
  |featureId |------------&gt;|featureId  |(secondTable's primary key)
  |foo       |             |featureName|
  |bar       |             +-----------+
  +----------+
  </code></pre>
  
  <p>I want to show fields from both these tables in the jsp from the single list object, I decided to use <code>@SecondaryTable</code>. These two tables are connected by the <code>featureId</code> field (which is a primary key for the <code>secondTable</code>), I want the <code>featureName</code> from the <code>secondTable</code> to be shown along with fields from the <code>firstTable</code>. The <code>FirstTablePojo</code> is preceded by this annotation:</p>
  
  <pre><code>@SecondaryTable(name="secondTable", 
      pkJoinColumns=@PrimaryKeyJoinColumn(name="featureId", 
                                          referencedColumnName = "featureId"))
  </code></pre>
  
  <p>I added this property to the <code>FirstTablePojo</code> (with getters and setters):</p>
  
  <pre><code> @ManyToOne
   @JoinColumn(name="featureId", table="secondTable")
   String featureName;
  </code></pre>
  
  <p>When with a help of <code>&lt;c:forEach items="${features}" var="feature"&gt;</code>, I get each <code>${feature.foo}</code> (<code>foo</code> is a property that was in the <code>FirstTablePojo</code> before I used <code>@SecondaryTable</code>) and <code>${feature.featureName}</code>, I see each <code>foo</code>, but none of the <code>featureNames</code> appear. It'd be great if someone could tell me what do I miss here and why feature's names from the other table do not appear in the list of <code>FirstTablePojo</code> objects. </p>