Ошибка в Hql - org.hibernate.hql.internal.ast.QuerySyntaxException: ожидание ЗАКРЫТЬ, найдено "ноль"
Я написал следующий HQL,
@Query("select fd.fdNumber,fd.depositAmount,fd.period, fd.withdrawalDate, select max(fh.maturityDate) as lastMaturtedDate from FDHistory fh JOIN fh.FixedDeposit fd where fd.status in('WDR','RWD') and fd.withdrawalDate between :start and :end");
И я закончил с
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: expecting CLOSE, found 'null' near line 1, column 261 [select fd.fdNumber,fd.depositAmount,fd.period, fd.withdrawalDate, (selec
at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:91) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:109) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:304) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:203) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:158) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:126) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:88) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:190) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
Я ищу решение, но не могу. Пожалуйста, помогите мне с этим.