【发布时间】:2020-09-13 20:20:56
【问题描述】:
我有一个 CRUD 应用,使用 Kotlin 中的 Spring REST 数据创建。
@Repository
interface OrderRepository : PagingAndSortingRepository<Order, Long>, QuerydslPredicateExecutor<Order>, QuerydslBinderCustomizer<QOrder> {
override fun customize(bindings: QuerydslBindings, root: QOrder) {
bindings.bind(root.address.name)
.first(StringExpression::containsIgnoreCase)
}
}
我已经自定义了我的 QuerydslPredicateExecutor,根据一些示例,当我运行上述应用程序时,我从 Spring 收到一个初始化错误,上面写着:
org.springframework.data.mapping.PropertyReferenceException: No property customize found for type Order!
我认为这可能是 Kotlin 的问题,可能它没有按照 Spring 的预期进行编译,现在正在尝试创建一个新的数据访问函数,而不是仅仅自定义 QueryDSLBinder?
【问题讨论】:
标签: spring kotlin spring-data