title: How to make an inner join between 2 table with JPA
body: <p>How to write a JPA query that make a join between 2 entities that doesn't share any reference between them I mean no Relation has been defined in the mapping </p>
  
  <pre><code>EntityA
  @Id
  long id
  
  String field1
  String field2
  
  EntityB
  @Id
  String field1
  @Id
  String field2
  </code></pre>
  
  <p>How can I write a join like This in JPQL</p>
  
  <pre><code>select entityB from entityA,entityB
  where entityB.field1 = entityA.field1
  and entityB.field2 = entityA.field2
  </code></pre>
  
  <p>Thanks</p>