Hibernate criteria count over with group by

I am using oracle db.
To summarize my options (correct me if I’m wrong) I can:

  1. Make it as a subquery (in native sql only, as hibernate criteria API does not allow to use subselect in the from clause):
select count(*) as totalNumber
from (select distinct u.first_name, u.last_name, u.age from users u)
  1. Using blaze persistence:
CriteriaBuilder<String> cb = cbf.create(em, Long.class)
    .from(User.class, "user")
    .select("FUNCTION('COUNT_TUPLE', 'DISTINCT', u.firstName, u.lastName, u.age)");
  1. Using my first appoach count(*) over() (hibernate with native sql):
select
count(*) OVER () as totalRecords
  from users u
  group by
    u.first_name,
    u.last_name,
    u.age
  order by u.age DESC
OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY;
  1. I am not able to accomplish that using native hibernate criteria API without help from additional libraries, like blaze (considering I am using hibernate criteria and oracle db) - but can be done with JPA Criteria

Am I right ?