java.sql.SQLException: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY -


I have a method in the Dao class that is list & lt; Object [] & gt; I & # 39; re using name and query

  public list & lt; Object [] & gt; GetListByCustomer (session session, integer customer ID, list & lt; integer & gt; strIds) {query named = session .createSQLQuery (query constant.export); NameQuery.setParameter ("Customer", Customer ID); NameQuery.setParameter ("stringId", strIds); & Lt; Object [] & gt; Objects = nameQuery.list (); Return items; }   

me the list & lt; Integer & gt; String in stringed id in named query

  public class query constant {public static final string export = "SELECT sv.NAME, sv.TYPE, sv.CLIENT_ADDRESS, sv NAME_REDUNDANT, sv View from "DEPARTURE_DATE, s1.CODE, sv.STATE, sv.CODE" + "sv, Process P1, SET s1" + "WHERE sv.R_ID = p1.R_ID and p1.ISSUER_ID = s1.USER_ID and sv .CUSTOMER_ID = : Customer and sv.R_ID IN (: stringId) "; }   

But I'm getting ORA-0932: Incompatible datatype: The expected number is Binari.

In addition to this, when I remove sv from R_ID IN (: stringId) query it works fine and when I type integer (strIds) < / code> instead of list & lt; Integer & gt;

I think you just

  IN: string ID)   

instead of IN: stringId

for JPA

  named .set parameter ("string id I", strings);   

is correct, but for hibernate you should use

  nameQuery.setParameterList ("stringId", strIds);    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -