Hi, i have a problem with a query. I need compare a List of String in the WHERE IN clause but i dont have results:
I have this code in java: .... String[] codes = {"CODE_A", "CODE_B"}; HashMap whereClause = new HashMap(); whereClause.put("codes", codes); List result = getObjectPersisterService() .executeNamedQuery("findDataUsingNamedQuery", whereClause);
In my namedQuery.xml file i have:
<query name="findDataUsingNamedQuery"> <![CDATA[ SELECT company FROM net.model.company AS company LEFT JOIN company.credential AS credential WHERE credential.code IN (:code) ]]> Any sugestions?
Thanks! This query works fine if i have one string: String codes = "CODE_A"; or if i use in the WHERE clause this: WHERE credential.code IN ('CODE_A', 'CODE_B')
|