I feel the following queries, which are valid SQL should be valid HQL.
SELECT (SELECT 1)
SELECT (SELECT 1), (SELECT 2)
But instead they throw:
3157 [main] ERROR org.hibernate.hql.PARSER - <AST>:0:0: unexpected end of subtree
Running against HSQLDB 2.0.1-rc3
I'm not sure whether HQL should support any possible SQL or not. This is not my case, but there were some other SQL queries which I wished HQL would support too.
What I'm really doing is doing subselects and returning an array of counts. I feel it's important that HQL support this.
These types of discussions are best started at Hibernate's user forums: https://forum.hibernate.org/viewforum.php?f=1. Please open JIRA tickets only for concise, reproduceable issues with an attached test case. Thanks!