Setting a parameter as a list for an IN expression

前端 未结 9 2500
北荒
北荒 2020-11-30 07:14

Whenever I try to set a list as a parameter for use in an IN expression I get an Illegal argument exception. Various posts on the internet seem to indicate that this is poss

9条回答
  •  一向
    一向 (楼主)
    2020-11-30 08:03

    Hope this helps some one. I have faced the issue and did the following to resolve (using eclipselink 2.2.0)

    1. I had JavaEE jar as well as jpa 2 jar(javax.persistence*2*) in the class path. Removed the JavaEE from the class path.

    2. I was using something like " idItm IN ( :itemIds ) " which was throwing the exception :

    type class java.util.ArrayList for parameter itemIds with expected type of class java.lang.String from query string

    Solution: I just changed the in condition to " idItm IN :itemIds ", i.e. I removed the brackets ().

提交回复
热议问题