rzo1 opened a new pull request, #333:
URL: https://github.com/apache/openjpa/pull/333

   https://issues.apache.org/jira/browse/OPENJPA-2732
   
   A query executed with a parameter it does not declare failed with the 
message for missing parameters ("Cannot execute query; declared parameters 
"extra" were not given values ..."), which reads as if `extra` were a declared 
parameter without a value.
   
   Fix: `QueryImpl.assertParameters` now uses a new message `undeclared-param` 
for a parameter that the query does not declare, naming it and listing the 
declared parameters. The existing `extra-params` message is about the number of 
parameters and does not fit a single unknown name. A declared parameter without 
a value still gets `unbound-params`. Braces added to both `if`s.
   
   This path is reached through the kernel API (`Query.execute(Map)`, 
`deleteAll(Map)`, `updateAll(Map)`); in the JPA API `setParameter` already 
rejects unknown names with an `IllegalArgumentException`.
   
   Tests (Derby): new `TestUndeclaredQueryParameter` runs a JPQL query through 
the broker with an undeclared parameter and checks the message; it fails 
without the fix. openjpa-lib, openjpa-kernel and the query, jpql, datacache and 
criteria packages of openjpa-persistence-jdbc pass.
   
   TCK: https://github.com/apache/openjpa/actions/runs/46485277518, Databases: 
https://github.com/apache/openjpa/actions/runs/46485284013 (running)
   


-- 
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]

Reply via email to