Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想找到所有名称类似?1%但不在传入列表中的用户?2:
?1%
?2
我使用此方法名称:findByNameStartingWithAndNotIn但我收到此错误:
findByNameStartingWithAndNotIn
No property notIn found for type User!
这是否意味着我必须编写自己的自定义 SQL?
Spring 数据也不知道您也想Name用于第二个子句。
Name
只需单独指定,尝试:
List<User> findByNameStartingWithAndNameNotIn(String prefix, List<String> namesToExclude)