Incorrect JPQL warning for input parameters in UPDATE SET clause when using Hibernate
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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
- 平均マージ
- 4日 21時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
-
The main Options dialog window has buttons with OK on the left instead of on the right on Linuxオープン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 日以内に返信
apache/netbeans の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
sqlcipher/sqlcipher-android#97 · コメント 1 件 ·
-
bug IIIF interoperability
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Netcracker/qubership-integration-platform#1046 ·
メンテナーはふだん 2 日以内に返信
-
`check_java_version()` fails when Java path contains spaces (Windows / Git Bash, `C:\Program Files`)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100