Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#9,638 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java
Área
tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Java
Estrellas
3.1k
Forks
939
Merge medio
4 d 17 h
PR fusionados (30 d)
32

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/netbeans

Todos los issues de apache/netbeans

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.