简体   繁体   English

org.hibernate.QueryException: 意外标记:在 hql 中使用

[英]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.

相关问题 org.hibernate.QueryException:意外令牌:as - org.hibernate.QueryException: unexpected token: as org.hibernate.QueryException:意外的char:&#39;`&#39; - org.hibernate.QueryException: unexpected char: '`' 执行HQL查询时org.hibernate.queryexception错误 - org.hibernate.queryexception error while executing HQL Query 休眠:org.hibernate.QueryException - Hibernate : org.hibernate.QueryException org.hibernate.QueryException:无法解析路径,意外令牌[尝试使用左连接] - org.hibernate.QueryException: Unable to resolve path, unexpected token [trying to use left join] 引起:org.hibernate.QueryException:节点没有数据类型:org.hibernate.hql.internal.ast.tree.MethodNode - Caused by: org.hibernate.QueryException: No data type for node: org.hibernate.hql.internal.ast.tree.MethodNode Hibernate org.hibernate.QueryException: 不是实体 - Hibernate org.hibernate.QueryException: not an entity 条件引发org.hibernate.QueryException:无法解析属性,但HQL起作用 - Criteria throws org.hibernate.QueryException: could not resolve property but HQL works org.hibernate.QueryException-无法解析属性 - org.hibernate.QueryException— could not resolve property org.hibernate.QueryException:预期的位置参数 - org.hibernate.QueryException: Expected positional parameter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM