我需要编写一个select查询从Spring Data Repository层中的多个表中获取数据.我知道我们可以使用@Query编写自定义查询,但只返回单个表中的值?
SELECT s.service_id, s.name, us.rating_id
FROM services s,
ratings r,
user_services us
where
us.service_id = s.service_id and
us.rating_id = r.rating_id and
us.user_id= ?;
Run Code Online (Sandbox Code Playgroud)