微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

org.jdbi.v3.core.statement.UnableToCreateStatementException:在查询声明无时提供了多余的命名参数

如何解决org.jdbi.v3.core.statement.UnableToCreateStatementException:在查询声明无时提供了多余的命名参数

    return [i for x in final_expression for i in x]

我想从 userTypes 列表中获取 Id 列表。
这里 User.UserType 是一个枚举。在方法(getUserIdsBylistofTypes)中,我传递了枚举类型列表的参数(userTypes)。
我无法理解查询中的问题在哪里。

解决方法

我没有采用枚举类型的列表,而是采用了字符串列表。

@SqlQuery("Select id from user where type::text in (<userType>)")   
List<Long> getUserIdsByListOfTypes(@BindList("userType") List<String> userType);  

How to search an enum in list of strings by postgresql query?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。