【发布时间】:2019-06-09 23:11:18
【问题描述】:
我有一个简单的测试项目,用 Spring Boot 版本检查 spring-data-neo4j:2.1.0.RELEASE (https://github.com/tomkasp/neo4j-playground/blob/master/src/main/java/com/athleticspot/neo4jplayground/domain/AthleteRepository.java)
spring-data-neo4j (version: 5.1.4.RELEASE) 依赖由 spring-boot-starter-data-neo4j 注入。
我的目标是创建一个存储库方法,该方法可以获取具有包含和不包含大小写功能的数据。为了做到这一点,我在存储库中创建了以下方法:
public interface AthleteRepository extends CrudRepository<Athlete, Long> {
List<Athlete> findByNameContainingIgnoreCase(String name);
}
当我运行上面的函数时,我得到:
java.lang.IllegalStateException: Unable to ignore case of java.lang.String types, the property 'name' must reference a String
at org.springframework.util.Assert.state(Assert.java:73) ~[spring-core-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.data.neo4j.repository.query.filter.PropertyComparisonBuilder.applyCaseInsensitivityIfShouldIgnoreCase(PropertyComparisonBuilder.java:101) ~[spring-data-neo4j-5.1.2.RELEASE.jar:5.1.2.RELEASE]
spring-data-neo4j 不支持 Containing 和 IgnoreCase 一起使用吗?我错过了什么吗?
【问题讨论】:
-
你找到解决这个问题的方法了吗?
-
它已被添加到 Moore 发布火车 jira.spring.io/browse/DATAGRAPH-1190 的功能集中(并已解决)
标签: spring-boot neo4j spring-data spring-data-neo4j