Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Incorrect JPQL warning for input parameters in UPDATE SET clause when using Hibernate

オープン
#9,638 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java
領域
tooling

調査の方向性

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 の本文から書いたものです。

説明

hints Java Java EE/Jakarta EE kind:bug needs:triage
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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/netbeans のほかの issue

apache/netbeans の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。