The objective is to implement the next SQL using JPA:
SELECT f.id as id, f.entity_name as entity_name, f.entity_id as entity_id, CASE f.entity_name WHEN