I need to order my selected items by status name sequence. (active <- inactive).
I wrote its SQL query correctly as follows. I need to convert it into jpa repository. please help me.
select * from device
where status in ('active', 'inactive')
order
by field(status,'active', 'inactive')

You will have to use a case when expression i.e.
case status when 'active' then 0 when 'inactive' then 1 else null end. With JPA Criteria this looks roughly like this: