首页 > 解决方案 > IN , AND 休眠中的查询

问题描述

我想使用hibernate查询spring boot。但是我在条件和标准上都试过了,但似乎不起作用。

我想做一个 SQL 查询:SELECT * FROM db1_test.device where user_id in " + customerIds + ") and 'app_id' like '%text-v2%

如果我将它输入到 MYSQL 中,它应该可以工作。user_id是用户输入的字符串。

我收到了这个错误:

org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet

标签: javasqlspringhibernate

解决方案


推荐阅读