Reputation: 11882
I use spring Data LDAP, I want return all user but by page. findAll
work but return all user.
I try user Page<UserLdap> findAll(Pageable pageable);
but I have tise error:
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!
full code:
public interface UserLdapRepository extends LdapRepository<UserLdap> {
Set<UserLdap> findAll();
Page<UserLdap> findAll(Pageable pageable);
}
I try add extends PagingAndSortingRepository<UserLdap, Name>
but I have the same error.
full code:
public interface UserLdapRepository extends PagingAndSortingRepository<UserLdap, Name>, LdapRepository<UserLdap> {
Set<UserLdap> findAll();
Page<UserLdap> findAll(Pageable pageable);
}
Is it possible using Pageable with Spring Data LDAP please?
EDIT:
I find this code in Spring Data ldap:
public Page<T> findAll(Predicate predicate, Pageable pageable) { ...
What is it a predicate please? If you have a sample, I'm happy :)
Upvotes: 1
Views: 2380
Reputation: 509
"Due to specifics of the LDAP protocol, paging and sorting are not supported for Spring LDAP repositories."
See more in https://docs.spring.io/spring-data/ldap/docs/current/reference/html/#ldap.repositories
Upvotes: 1
Reputation: 11882
it is not possible:
UnsupportedOperationException()
@Override
public Page<T> findAll(Predicate predicate, Pageable pageable) {
throw new UnsupportedOperationException();
}
Upvotes: 1