In my java spring mvc application, i have two classes:

```
@Entity
public class Transactions {

    @Id
    @GeneratedValue
    long id;

    @OneToOne
    Customer customer;
    @OneToOne
    Merchant merchant;

    double value;
}

```

and the customer class is:

```
@Entity

public class Customer {

    @Id
    @GeneratedValue
    long id;

    String name;
    String ageClass;

    String language;
    String cardUserArea;

}

```

The repository for the Transactions is:

```
@Repository
public interface TransactionRepository  extends JpaRepository<Transactions ,Long >{

    @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);
}

```

But it complains with:

```
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 ]

```

**The query runns successfully against the database**