title: Hibernate @ManyToMany joinTable - OrderBy using join table's field
body: <p>There are 3 tables:</p>
  
  <p>TABLE_A<br />
  ID_A<br />
  field1<br />
  fieldN<br /></p>
  
  <p>TABLE_B<br />
  ID_B<br />
  field1<br />
  fieldN<br /></p>
  
  <p>TABLE_A_B<br />
  ID_A<br />
  ID_B<br />
  orderField<br /></p>
  
  <pre><code>public class A(){
      @ManyToMany
      @JoinTable(name="TABLE_A_B", joinColumns={@JoinColumn(name="ID_A")}, inverseJoinColumns={@JoinColumn(name="ID_B")})
      @OrderBy(value="orderField")
      private List&lt;TABLE_B&gt; BList;
  }
  </code></pre>
  
  <p>But it isn't working, instead I get a runtime error:</p>
  
  <pre><code>Caused by: org.postgresql.util.PSQLException: ERROR: column B1_.orderField doesn't exist Position: 1437
  </code></pre>
  
  <p>Hibernate searches the field in TABLE_B. Is it possible to use "OrderBy" in a many to many relationship using a join table's field? Or any other way to get to order based in the same field?</p>