title: What is this JPA error and how to fix it?
body: <p>My TableX has reference to TableY. </p>
  
  <pre><code>@JoinColumn(name = "idTableY", referencedColumnName = "idTableY")
  @ManyToOne(optional = false, fetch=FetchType.LAZY)
  private TableY idTableY; 
  </code></pre>
  
  <p>and I get this error.</p>
  
  <pre><code>&lt;openjpa-2.0.0-r422266:935683 fatal user error&gt; org.apache.openjpa.persistence.ArgumentException 
  "com.mycompany.entities.TableX.idTableY" has columns with targets, but OpenJPA does not support any joins on this mapping in this context.
  </code></pre>
  
  <p>Table Y has this code:</p>
  
  <pre><code> @OneToMany(cascade = CascadeType.ALL, mappedBy = "idTableY")
      private Collection&lt;TableX&gt; tableXCollection;
  </code></pre>
  
  <p>This generated eclipse-link code is 100% normal ( all other entities/tables with similar code have no problems).</p>
  
  <p>But a couple of these are giving such errors. Any idea why?</p>