FROM 子句中的 QueryDSL 4.x 子查询
QueryDSL 4.x subqueries in the FROM clause
最新的QueryDSL版本是否支持from子句中的子查询?我尽力了,但暂时找不到解决方案。
这不是 QueryDSL 问题,而是 JPQL 限制。仅对 Select 和 Where 子句支持子查询。来自 Hibernate documentation:
Note that HQL subqueries can occur only in the select or where clauses.
如果您希望以这种方式使用子查询,则需要使用本机查询。例如,查询迁移参见 JPA subquery in from clause。 QueryDSL 支持原生查询,所以原则应该是可翻译的。
最新的QueryDSL版本是否支持from子句中的子查询?我尽力了,但暂时找不到解决方案。
这不是 QueryDSL 问题,而是 JPQL 限制。仅对 Select 和 Where 子句支持子查询。来自 Hibernate documentation:
Note that HQL subqueries can occur only in the select or where clauses.
如果您希望以这种方式使用子查询,则需要使用本机查询。例如,查询迁移参见 JPA subquery in from clause。 QueryDSL 支持原生查询,所以原则应该是可翻译的。