OpenJPA sometimes incorrectly complains about wrong number of parameters
------------------------------------------------------------------------
Key: OPENJPA-2016
URL: https://issues.apache.org/jira/browse/OPENJPA-2016
Project: OpenJPA
Issue Type: Bug
Affects Versions: 2.1.0, 2.2.0
Environment: Windows XP, Sun JDK 1.6.0_24, Maven 2.2.1
Reporter: Ognjen Blagojevic
OpenJPA sometimes incorrectly complains about wrong number of parameters, e.g.:
"47 test WARN [main] openjpa.Runtime - Supplied user parameters "[name,
nameDiscriminator]" do not match expected parameters "[name]" for the prepared
query "PreparedQuery: [SELECT o FROM simple o WHERE ((:nameDiscriminator=false)
OR (o.name = :name))] --> [SELECT t0.ID, t0.NAME, t0.VALUE FROM SIMPLE_ENTITY
t0 WHERE (1=0 OR t0.NAME = ?)]".
I will add the patch to demonstrate the behavior. Run test at
openjpa-persistence-jdbc, e.g:
mvn -Dtest=TestQueryParameters test-compile test
The query is intentionally executed twice, since only second execution yields
warning message.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira