Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add paging to LdapRepository #3

Closed
wants to merge 1 commit into from

Conversation

houcheng
Copy link

@houcheng houcheng commented Apr 5, 2017

This commit adds paging query feature to data LDAP. The following two functions are added into LdapRepository interface:

	Page<T> findAll(Pageable pageable);
	Page<T> findAll(LdapQuery ldapQuery, Pageable pageable);

The paging query can be easily performed by the following code:


    Page<UnitTestPerson> pagedResult = tested.findAll(PageRequest.of(0, 50));
    while(true) {
        processData(pagedResult.getContent());

        if(pagedResult.hasNext()) {
            pagedResult = tested.findAll(pagedResult.nextPageable());
        } else {
            break;
        }
    }

@houcheng
Copy link
Author

houcheng commented Apr 7, 2017

Hi @mp911de

The PR is blocked by building error. The building for springldap-next profile was failed with the error message:

[ERROR] Failed to execute goal on project spring-data-ldap: Could not resolve dependencies for project org.springframework.data:spring-data-ldap:jar:2.0.0.BUILD-SNAPSHOT: Failure to find org.springframework.ldap:spring-ldap-core:jar:2.4.0.BUILD-SNAPSHOT in https://oss.sonatype.org/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-snapshots has elapsed or updates are forced -> [Help 1]

Please look at this and thank you.
Houcheng

/cc @rwinch

@mp911de
Copy link
Member

mp911de commented Apr 21, 2017

Thanks for your PR. I will take it from here.

@mp911de
Copy link
Member

mp911de commented Apr 21, 2017

I adapted your code at https://github.com/spring-projects/spring-data-ldap/tree/issue/DATALDAP-30 and introduced sliced query execution for repository query methods.

@houcheng
Copy link
Author

Thank you.

@mp911de mp911de self-assigned this Apr 26, 2017
@mp911de
Copy link
Member

mp911de commented Apr 26, 2017

Closing this pull request without merge as per comments in https://jira.spring.io/browse/DATALDAP-30. Thank you for your effort for this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants