In the following code I want to get the data from Order table and also from User table How can I modify my query so that I can achieve this ? user_id
is foreign key in order table
public interface OrderRepository extends JpaRepository<Order, Long> {
@Query("Select o from Order o where o.customer.id= :customerId and o.orderStatus='DELIVERED'")
List<Order> orderHistory(@Param("customerId") long customerId);
}