Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/390.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Hql-org.hibernate.Hql.internal.ast.QuerySyntaxException中出错:应为关闭,但发现“null”_Java_Hql - Fatal编程技术网

Java Hql-org.hibernate.Hql.internal.ast.QuerySyntaxException中出错:应为关闭,但发现“null”

Java Hql-org.hibernate.Hql.internal.ast.QuerySyntaxException中出错:应为关闭,但发现“null”,java,hql,Java,Hql,我写了以下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

我写了以下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]

我在寻找解决办法,但我做不到。请帮我解决这个问题。

@query选择fd.fdNumber、fd.depositAmount、fd.period、fd.drawalDate、maxfh.durationDate作为FDHistory fh的lastMaturtedDate加入fh.FixedDeposite fd,其中fd.status位于'WDR'、'RWD'和fd.drawalDate之间:开始和:结束;在查询中有两个select语句。。。对不起,我弄错了。通过这种方式@Queryselect fd.fdNumber,fd.depositAmount,fd.period,fd.DrawerDate,从FDHistory fh JOIN fh.fixedDeposito fd中选择maxfh.durationDate作为lastMaturtedDate,其中fd.status在'WDR'、'RWD'和fd.DrawerDate之间:开始和:结束;。secound select带有para。@Queryselect fd.fdNumber、fd.depositAmount、fd.period、fd.DrawerDate、maxfh.DurationDate作为FDHistory中的lastMaturtedDate fh JOIN fh.FixedDeposit fd,其中fd.status位于'WDR'、'RWD'和fd.DrawerDate之间:开始和:结束;在查询中有两个select语句。。。对不起,我弄错了。通过这种方式@Queryselect fd.fdNumber,fd.depositAmount,fd.period,fd.DrawerDate,从FDHistory fh JOIN fh.fixedDeposito fd中选择maxfh.durationDate作为lastMaturtedDate,其中fd.status在'WDR'、'RWD'和fd.DrawerDate之间:开始和:结束;。secound select带有段落。