Eccenux opened a new issue, #9638:
URL: https://github.com/apache/netbeans/issues/9638

   ### 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
   ```java
   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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to