I have this query and it is working as i expected
SELECT
COUNT(id) as views_per_day,
view_date::timestamp::date,
extract(dow from view_date::timestamp::date) as day_index
FROM details
WHERE view_date > current_date - interval '6' day
GROUP BY view_date::timestamp::date
ORDER BY view_date::timestamp::date;
I am using Hibernate in my project but i am a Hibernate newbie. What i want to know is how can i use functions like
`extract(dow from view_date::timestamp::date)`,
`interval '6' day` `view_date::timestamp::date`
in Hibernate or is there a way to run this as a raw sql without security vulnerabilities ? Any help would be appreciated