on 06-19-2007 10:28 AM
Hi ,
Following is a method in my session bean. Its trying to update 'Activities' entity through JPQL. I am using a named parameter 'var2' to set the value of 'actPst1Cd' field.
String stmt = "update Activities A set A.actPstlCd = :var2 where A.actRmatId = :var1";
Query query = em.createQuery(stmt);
query = query.setParameter("var1", new BigDecimal(1));
query = query.setParameter("var2", getVar2Value());
return query.executeUpdate();
On execution I am getting the following error.
java.lang.IllegalArgumentException: There is no parameter with name ':var2' in this JPQL-query. at com.sap.engine.services.orpersistence.query.QueryImpl.assertValidTypedValue(QueryImpl.java:303) at com.sap.engine.services.orpersistence.query.QueryImpl.setParameter(QueryImpl.java:369) at session.Test2Bean.testUpdate(Test2Bean.java:53) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
..
The named parameters in where clause are getting substituted successfully. Can anyone please tell me why its failing in set clause?
I am using SAP NetWeaver Application Server, Java(TM) EE 5 Edition for deployment.
Thanks,
Prasoon.
Hi Prasoon!
I am currently trying to reconstruct your issue. I need a confirmation on the version of Netweaver AS Java you use. You mention in your post that you use the Java EE 5 Edition. In contrast you wrote another post where you stated that you use the CE 7.1 version. Determining the verison is crucial for reconstructing and finding a solution.
Thanks & Best Regards,
Robin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robin ,
Thanks for replying..
Issue I have Posted here is coming in <b>Java EE 5 Edition</b>.
Regarding another post, I wanted to try CE 7.1 version when I found that my current entities ( which works in Java EE 5 Edition ) are giving error in CE7.1 because of Bigdecimal check in Entity Validation, hence posted another post.
Thanks,
Prasoon
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.