Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] jpql named parameter list as input does not work

We try to pass named parameter as a list in a jpql query. But we get the
following error:

{SELECT returnValue FROM Need returnValue WHERE  returnValue.type  = '001'
and  (  returnValue.type  = :type or  returnValue.BUID  IN (:BUID)  ) }

{SELECT returnValue FROM Need returnValue WHERE returnValue.type  = '001'
and  (  returnValue.type  = :type or  returnValue.BUID  IN (:BUID)  ) }

 INFO Caused by: java.lang.IllegalArgumentException: You have attempted to
set a value of type class java.util.ArrayList for parameter BUID with
expected type of class java.lang.String from query string 

SELECT returnValue FROM Need returnValue WHERE  returnValue.type  = '001'
and  (  returnValue.type  = :type or  returnValue.BUID  IN (:BUID)  ) .

 INFO   at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameterInternal(EJBQueryImpl.java:975)
 INFO   at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(EJBQueryImpl.java:862)
 ...

Info: it works with hibernate and we have a workaround by transforming list
content into a comma separated string.

Question: Bug or wrong usage of named parameter?

Kind regards,
Tom
-- 
View this message in context: http://www.nabble.com/jpql-named-parameter-list-as-input-does-not-work-tp25678654p25678654.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top