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)
query.setParameterList("typeIds",ids);
It got resolved using setParameterList();
You will get this same error if null == ids
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With