I have a problem when creating a JPQL query that is derived from a native Oracle SQL query. Some folks told me to use the native query, but I want to leverage the ability of persistence. Here is the native Oracle SQL statement:
SELECT a.taxnumber, b.compid, b.compnum,
(case
when b.score > 80 then 'LOW RISK'
when b.score between 65 and 80 then 'MEDIUM RISK'
when b.score > 65 then 'HIGH RISK'
else null end) status
FROM registers a, company b
Does anyone know how to convert it into a JPQL query? What I am confused by is the case when
statement...