posted 2 years ago
how to translate sql query to spring boot query?
select ru.id, ru.name,
case when a.r_id is null
then false
else true
end as acc
from ru
left join a
on ru.id = a.r_id and a.a_id = 1
left join b
on b.id = a.a_id
it doesn't work in this, where is problem:
@Query("select ru.id, ru.name,
case when a.r_id is null
then false
else true
end as acc
from ru
left join a
on ru.id = a.r_id and a.a_id = 1
left join b
on b.id = a.a_id")
List<ExamplesDto> getExamples();