Incorrect JPQL warning for input parameters in UPDATE SET clause when using Hibernate
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 3.1k
- Fork
- 939
- Merge medio
- 5g 12h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/netbeans
-
Contribution welcome kind:feature Platform
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/netbeans#9614 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
kind:bug LSP needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/netbeans#9548 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Editor Java kind:feature needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
The main Options dialog window has buttons with OK on the left instead of on the right on LinuxApertakind:bug needs:triage os:linux os:macos Platform UI
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
kind:bug needs:triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/netbeans
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
java-native-access/jna#1740 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
portfolio-performance/portfolio#6119 ·
I maintainer di solito rispondono entro 8 giorni
-
Bump up AWS SDK to 2.54.3Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
jenkinsci/ec2-plugin#2041 ·
-
L: github:actions L: php:composer
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
dependabot/dependabot-core#16493 ·
I maintainer di solito rispondono entro 1 giorno