org.hibernate.QueryException:意外的令牌:在hql中的WITH

时间:2016-08-09 14:58:16

标签: java sql hibernate hql hibernate-criteria

您正在尝试使用特定条件加入表格,当我执行以下查询并收到以下错误时

 org.hibernate.QueryException: unexpected token: WITH [

我的HQL QUERY在......

之下
> List results1=session.createQuery("select financialDetail from
> FinancialDetail financialDetail " +
>                "left join financialDetail.financialClaimHeaderInfo fhdrinfo WITH (fhdrinfo.chk='224') "+
>                " where financialDetail.fc=:fc")
>                .setParameter("fc",fc)
>                .list();

在financialDetail.hbm文件中,我有两个表之间的映射,如

<set name="financialClaimHeaderInfo" table="F_CLM_HDR_TB" lazy="true" inverse="true" cascade="all" >
          <key column="F_FCN_NUM" />
          <one-to-many class="com.FinancialClaimHeaderInfo"/>
      </set>

请指导我这里有什么问题...

1 个答案:

答案 0 :(得分:0)

你应该尝试把fhdrinfo.chk =&#39; 224&#39;进入何处。

 where financialDetail.fc=:fc and fhdrinfo.chk='224' 
相关问题