Reputation: 6997
i have an SQL like:
SELECT
t.name,
sum(t.value)
FROM
myTable t
WHERE
-- conditions...
GROUP BY
t.name
HAVING sum(t.value) >= 100
and i have:
select count(*) from (
-- QUERY1
) as countQuery
And i'm trying to do it on QueryDSL. I already have my Query 1 as an JPAQuery. Now a need to use it as a subquery, so i'm trying to do something like:
JPASubQuery subQuery = new JPASubQuery(query1.getMetadata());
new JPAQuery().from(subquery).count();
But it's not possible to add a SubQuery in the FROM clause.
It would be a nice feature.
Upvotes: 1
Views: 4600
Reputation: 6997
Ok, it's not possible due to JPA limitations:
https://github.com/querydsl/querydsl/issues/1471
Upvotes: 3