Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

operator does not exist: bigint = bytea

Here is my code:

     List<Long> ids= new ArrayList<Long>();
     ids.add(10L);ids.add(11L);
    String queryString ="select type_id from Types where parent_type_id in (:typeIds)";

    SQLQuery sqlQuery = session.createSQLQuery(queryString);

    sqlQuery.setParameter("typeIds", ids);
            List<Object[]> results = sqlQuery.list();

I am getting this error while executing the above query. FYI, I just saw this issue when I passed an array or ArrayList as paramter.

ERROR util.JDBCExceptionReporter: ERROR: operator does not exist:
bigint = bytea Exception in thread "main"
org.hibernate.exception.SQLGrammarException: could not execute query
    at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
    at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
like image 234
Naveen A Avatar asked Jan 30 '12 14:01

Naveen A


2 Answers

query.setParameterList("typeIds",ids);

It got resolved using setParameterList();

like image 95
Naveen A Avatar answered Nov 19 '22 07:11

Naveen A


You will get this same error if null == ids.

like image 4
Jan Nielsen Avatar answered Nov 19 '22 06:11

Jan Nielsen