在运行以下java代码时,我得到了一个异常:
List<Tuple> companies2accLoginCount = accoutLoginCountQuery
.listDistinct(new QTuple(QCompany.company1.id, QAccountLogin.accountLogin.loginDatetime.dayOfMonth().countDistinct()));例外情况:
java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: expecting CLOSE, found '(' near line 1, column 48 [select distinct company1.id, count(distinct day(accountLogin.loginDatetime))
from de.workxl.cxlbackend.database.model.Company company1
left join company1.accounts as account
left join account.accountLogins as accountLogin
where accountLogin.loginDatetime > ?1
group by company1.id
having count(distinct day(accountLogin.loginDatetime)) >= ?2]一年中的每一天都是如此。看起来,在一年中或月中的一天之后,除了左括号之外,还会有其他的东西。
我使用Hibernate 4.2.2和QueryDSL 2.9.0
更新:我刚刚成功地将项目迁移到了QueryDSL 3.2.3 (不得不将Spring-Data-Commons1.6.1和spring升级到1.4.1 ),但例外情况仍然存在。
发布于 2013-09-24 18:24:37
这似乎是Hibernate解析器中的一个bug。这适用于EclipseLink。
https://stackoverflow.com/questions/18984611
复制相似问题