org.hibernate.QueryException:意外标记:WITH在hql中 [英] org.hibernate.QueryException: unexpected token: WITH in hql

查看:115
本文介绍了org.hibernate.QueryException:意外标记:WITH在hql中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你试图加入具有特定条件的表,并且当我执行下面的查询并且得到下面的错误时

Hi am trying to join the tables with specific condition and when i executing the below query and am getting the below error

 org.hibernate.QueryException: unexpected token: WITH [

我的HQL QUERY低于... p>

my HQL QUERY is below...

> 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文件中,我有这两个表之间的映射,如

In the financialDetail.hbm file i have a mapping between these two table like


<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>


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

Pls guide me what is wrong here...

推荐答案

您应该尝试将'fhdrinfo.chk ='224'放入where-condition。

You should try to put 'fhdrinfo.chk='224' into the where-condition.

 where financialDetail.fc=:fc and fhdrinfo.chk='224' 

这篇关于org.hibernate.QueryException:意外标记:WITH在hql中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆