Search code examples
javaspring-dataquerydslspring-ldap

Spring Data LDAP using Pageable is it possible?


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 :)


Solution

  • it is not possible:

    UnsupportedOperationException()

    @Override
    public Page<T> findAll(Predicate predicate, Pageable pageable) {
        throw new UnsupportedOperationException();
    }