title: How to join two collection of an entity in JPA JPQL Query?
body: <p>I have encountered in a situation where I have a entity which is having two collections lets say</p>
  
  <pre><code>@Entity
  Company
  
  @OneToMany
  Collection&lt;Cars&gt;
  
  @OneToMany
  Collection&lt;Scooter&gt;
  </code></pre>
  
  <p>Here is my jpql</p>
  
  <pre><code>select e from com.net.company e JOIN e.cars cr where cr.carname IN ('BMW');
  </code></pre>
  
  <p><strong>works fine returns the company</strong></p>
  
  <pre><code>select e from com.net.company e JOIN e.cars cr JOIN e.scooter where cr.carname IN ('BMW');
  </code></pre>
  
  <p><strong>Does not returns anything</strong></p>
  
  <p>I do understand my jpql is wrong I think the issue is with the way I am joining it can some help me on this</p>