Incorrect JPQL warning for input parameters in UPDATE SET clause when using Hibernate
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
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
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
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/netbeans
-
Contribution welcome kind:feature Platform
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/netbeans#9614 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
kind:bug LSP needs:triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/netbeans#9548 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Editor Java kind:feature needs:triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
The main Options dialog window has buttons with OK on the left instead of on the right on LinuxAbiertokind:bug needs:triage os:linux os:macos Platform UI
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Incorrect DTD for wstcref-FilesAbiertokind:bug needs:triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/netbeans
Issues similares
-
`RedisList.reversed()` view returns an empty `range` and `trim` removes all elementsPosiblemente ocupada @CCCLL la tomó hoy. Abiertostatus: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
spring-projects/spring-data-redis#3461 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
devops-thiago/ThrillhouseBot#1093 ·
Los mantenedores suelen responder en 1 día
-
Missing htmx attribute processorAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
wimdeblauwe/htmx-spring-boot#205 ·
-
[BUG] 增量 SSE 解析器未识别单独 CR 换行,导致事件无法及时交付Posiblemente ocupada @king-wwwhhh la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
langchain4j/langchain4j#6669 ·
Los mantenedores suelen responder en 1 día
-
enhancement tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Albertinesilva/backend-engineering-journey-java-springboot#41 ·