title: JPA Error: Path expected for join
body: <p>In my java spring mvc application, i have two classes:</p>
  
  <pre><code>@Entity
  public class Transactions {
  
      @Id
      @GeneratedValue
      long id;
  
      @OneToOne
      Customer customer;
      @OneToOne
      Merchant merchant;
  
      double value;
  }
  </code></pre>
  
  <p>and the customer class is:</p>
  
  <pre><code>@Entity
  
  public class Customer {
  
      @Id
      @GeneratedValue
      long id;
  
      String name;
      String ageClass;
  
      String language;
      String cardUserArea;
  
  }
  </code></pre>
  
  <p>The repository for the Transactions is:</p>
  
  <pre><code>@Repository
  public interface TransactionRepository  extends JpaRepository&lt;Transactions ,Long &gt;{
  
      @Query("SELECT sum( value)  FROM Transactions  inner  join Customer on  Transactions.customer_id=Customer.id   where merchant_id= ?1 and age_class= ?2 ")
      public double getOverAllValue(String merchantID,String ageGroup);
  }
  </code></pre>
  
  <p>But it complains with:</p>
  
  <pre><code>org.hibernate.hql.internal.ast.QuerySyntaxException: Path expected for join! [SELECT sum( value)  FROM ee.seb.domain.Transactions  inner  join Customer on  Transactions.customer_id=Customer.id   where merchant_id= ?1 and age_class= ?2 ]
  </code></pre>
  
  <p><strong>The query runns successfully against the database</strong></p>