openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Hongell (JIRA)" <>
Subject [jira] Created: (OPENJPA-111) native queries fail when use named parameters
Date Thu, 25 Jan 2007 01:25:49 GMT
native queries fail when use named parameters

                 Key: OPENJPA-111
             Project: OpenJPA
          Issue Type: Bug
         Environment: windows xp, openjpa_097_incubating
            Reporter: George Hongell

native queries fail when use named parameters

 int parm3 = 100;
String sql = "SELECT deptno,budget,NAME,MGR_EMPID,REPORTSTO_DEPTNO FROM DeptBean WHERE deptno
>= :deptno ";
Query getDept = _em.createNativeQuery(sql,DeptBean.class
List<DeptBean> rl = (getDept.getResultList());

<4|false|0.9.7-incubating-SNAPSHOT> org.apache.openjpa.persistence.ArgumentException:
The parameter name or position "deptno" passed to execute() is not valid.  All map keys must
be a declared parameter name or a number matching the parameter position. 
	at org.apache.openjpa.kernel.QueryImpl.toParameterArray(
	at org.apache.openjpa.kernel.QueryImpl.execute(
	at org.apache.openjpa.kernel.QueryImpl.execute(
	at org.apache.openjpa.kernel.DelegatingQuery.execute(
	at org.apache.openjpa.persistence.QueryImpl.execute(
	at org.apache.openjpa.persistence.QueryImpl.getResultList(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at junit.framework.TestCase.runTest(Unknown Source)
	at junit.framework.TestCase.runBare(Unknown Source)
	at junit.framework.TestResult$1.protect(Unknown Source)
	at junit.framework.TestResult.runProtected(Unknown Source)
	at Source)
	at Source)
	at junit.framework.TestSuite.runTest(Unknown Source)
	at Source)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message