title: Spring framework data JPA Inner Join on multiple columns
body: <p>I would like to do the following query using spring jpa. I am able to build the where clause for my statement with Predicate.toPredicate. However, I don't know how to join on more than one column. On a single column it can be done in the repository using @Query and @Param</p>
  
  <pre><code>SELECT a.name, a.column_x, b.column_y
  FROM table_a a
  INNER JOIN table_b b
  ON b.name = a.name
  AND b.pk_2 = a.pk_2
  AND b.pk_3 = a.pk_3
  WHERE ...;
  </code></pre>
  
  <p>Another question I have is, is an intermediate tableA_tableB association beneficial if I have something like this, oneToMany relations.</p>
  
  <p>Table 1: thing</p>
  
  <p>thing_name</p>
  
  <p>type</p>
  
  <p>tenant</p>
  
  <p>other1</p>
  
  <p>other2</p>
  
  <hr>
  
  <p>Table 2: thing_sub_prop</p>
  
  <p>prop_name</p>
  
  <p>value</p>
  
  <hr>
  
  <p>Association table: thing_thing_sub_prop</p>
  
  <p>type</p>
  
  <p>thing_name</p>
  
  <p>tenant</p>
  
  <p>prop_name</p>
  
  <h2>value</h2>
  
  <p>Or is it better to just have two tables, thing and thing_sub_prop with the primary key columns of thing repeated in thing_sub_prop as a foreign key?</p>