【发布时间】:2017-10-24 13:21:49
【问题描述】:
我使用 spring Data LDAP,我想返回除页面之外的所有用户。 findAll 工作但返回所有用户。
我尝试使用用户 Page<UserLdap> findAll(Pageable pageable);,但出现错误:
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'userLdapRepository':
Invocation of init method failed;
nested exception is org.springframework.data.mapping.PropertyReferenceException:
No property findAll found for type UserLdap!
完整代码:
public interface UserLdapRepository extends LdapRepository<UserLdap> {
Set<UserLdap> findAll();
Page<UserLdap> findAll(Pageable pageable);
}
我尝试添加extends PagingAndSortingRepository<UserLdap, Name>,但我遇到了同样的错误。
完整代码:
public interface UserLdapRepository extends PagingAndSortingRepository<UserLdap, Name>, LdapRepository<UserLdap> {
Set<UserLdap> findAll();
Page<UserLdap> findAll(Pageable pageable);
}
是否可以将 Pageable 与 Spring Data LDAP 一起使用?
编辑:
我在 Spring Data ldap 中找到了这段代码:
public Page<T> findAll(Predicate predicate, Pageable pageable) { ...
请问它是什么谓词?如果你有样品,我很高兴:)
【问题讨论】:
标签: java spring-data querydsl spring-ldap