Nav*_*n A 3 postgresql hibernate
这是我的代码:
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();
Run Code Online (Sandbox Code Playgroud)
我在执行上述查询时收到此错误.仅供参考,当我将数组或ArrayList作为参数传递时,我刚刚看到了这个问题.
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)
Run Code Online (Sandbox Code Playgroud)
query.setParameterList("typeIds",ids);
Run Code Online (Sandbox Code Playgroud)
它得到了解决 setParameterList();
| 归档时间: |
|
| 查看次数: |
10016 次 |
| 最近记录: |