Incorrect JPQL warning for input parameters in UPDATE SET clause when using Hibernate
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
No source file or test is named. Reproduce the warning in a Java Maven application using the provided Hibernate UPDATE query, then locate the NetBeans JPQL validation code that rejects parameters in SET clauses. Done means the warning is no longer reported for this valid query, with a regression test covering the case.
由索引模型根据 Issue 内容生成。
描述
Apache NetBeans version
Apache NetBeans 31
What happened
NetBeans incorrectly reports a JPQL warning when a named input parameter is used in the SET clause of an UPDATE query. Which is completely fine AFAIK when using Hibernate session.
Language / Project Type / NetBeans Component
Java Maven application project
How to reproduce
Example code
return sessionFactory.getCurrentSession()
.createQuery("""
UPDATE ChangeLogEntity
SET info = :info
WHERE changedEntityId = :changedEntityId
AND objectType = :objectType
""")
.setParameter("info", info)
.setParameter("changedEntityId", changedEntityId)
.setParameter("objectType", objectType)
.executeUpdate();
NetBeans reports the following warning for the use of SET info = :info:
Input parameters can only be used in the WHERE clause or HAVING clause of a query.
This warning appears to be incorrect. This JPQL/HQL work correctly with Hibernate.
Expected behavior
No warning should be reported for an input parameter used as a value in the SET clause of an UPDATE query.
Or perhaps have an ability to suppress different JPQL warnings separately (either with @ anotations or in settings).
Actual behavior
NetBeans reports that input parameters are only allowed in WHERE or HAVING clauses.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 11
JDK
JDK v17 for builds, v21 for running NB
Apache NetBeans packaging
Community provided installer
Anything else
No response
Are you willing to submit a pull request?
No
- 主要语言
- Java
- 星标
- 3.1k
- 派生
- 939
- 平均合并
- 5 天 3 小时
- 30 天内合并 PR
- 22
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/netbeans 的其他 Issue
-
Contribution welcome kind:feature Platform
难度 2/5 1-3 小时 新手友好度 72/100
apache/netbeans#9614 · 2 条评论 ·
维护者通常 1 天内回复
-
kind:bug LSP needs:triage
难度 2/5 1-3 小时 新手友好度 78/100
apache/netbeans#9548 · 1 条评论 ·
维护者通常 1 天内回复
-
Editor Java kind:feature needs:triage
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
kind:bug needs:triage os:linux os:macos Platform UI
难度 1/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
kind:bug needs:triage
难度 1/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
相似的 Issue
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 62/100
opfab/operatorfabric-core#10653 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
GeminiUtil placeholder user turn ("Continue output. DO NOT look at this line ...") is flagged by prompt injection filters可能已有人在做 @innoprej 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
salesforce/multicloudj#667 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 2 天内回复