[英]org.hibernate.QueryException: unexpected token: WITH in 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 [
my HQL QUERY is below...我的 HQL 查询在下面...
> 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();
In the financialDetail.hbm file i have a mapping between these two table like在 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>
Pls guide me what is wrong here...请指导我这里有什么问题......
您应该尝试将 'fhdrinfo.chk='224' 放入 where-condition 中。
where financialDetail.fc=:fc and fhdrinfo.chk='224'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.