我需要将此 SQL 查询转换为 HQL
select
*
from
( select
routemaste0_.ROUTE_ID as col_0_0_,
routemaste0_.ROUTE_CODE as col_1_0_,
routemaste0_.START_PLACE_ID as col_2_0_,
routemaste0_.END_PLACE_ID as col_3_0_,
routemaste0_.IS_ACTIVE as col_4_0_,
routemaste0_.LINKED_ROUTE as col_5_0_
from
OPRS_ROUTE_MASTER routemaste0_
inner join OPRS_ROUTE_HALTS routehalts0_
on routemaste0_.route_id = routehalts0_.route_id
where routehalts0_.PLACE_ID = '51'
order by
routemaste0_.ROUTE_ID ASC )
我试过这种方式
SELECT rm.id ,
rm.routeCode ,
rm.startPlaceId ,
rm.endPlaceId ,
rm.active ,
rm.linkedRoute
FROM RouteMaster rm
INNER JOIN rm.routeHalts AS rh
WHERE rm.id = rh.routeId
AND rh.placeId = :PlaceId
ORDER BY rm.id ASC
但没有得到预期的结果。我担心的是我需要inner join on
执行条件。
有人能帮我吗