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

findAll() ignoring base attribute from @Entry #31

Open
jenslofgren opened this issue Aug 24, 2015 · 10 comments
Open

findAll() ignoring base attribute from @Entry #31

jenslofgren opened this issue Aug 24, 2015 · 10 comments
Milestone

Comments

@jenslofgren
Copy link

SimpleLdaprepository's findAll() wich in turn calls

ldapOperations.findAll(clazz);

Seems to ignore any base set in the @entry class

    /**
     * {@inheritDoc}
     */
    @Override
    public <T> List<T> findAll(Class<T> clazz) {
        return findAll(LdapUtils.emptyLdapName(),
                getDefaultSearchControls(defaultSearchScope, RETURN_OBJ_FLAG, ALL_ATTRIBUTES),
                clazz);
    }

Wich results in that the base attribute in the @entity doens't work for LdapRepositorys findAll() method.

@trorbyte
Copy link

Also seeing this on any find methods

@bhuism bhuism mentioned this issue Mar 28, 2016
@bhuism bhuism mentioned this issue Jun 22, 2016
@lewisheadden
Copy link

lewisheadden commented Aug 1, 2016

I am also seeing this. Has this really been open for over a year? It seems like a fairly major bug in Spring LDAP that should be more clearly documented if it can't be fixed more easily.

Should ObjectDirectoryMapper override the baseFilter when calling ObjectDirectoryMapper#filterFor (e.g. should DefaultObjectDirectoryMapper#addManagedClass be handling this)? Or should we be checking for class annotations in https://github.com/spring-projects/spring-ldap/blob/master/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java#L1814?

@bhuism
Copy link

bhuism commented Aug 5, 2016

@lewisheadden I've fixed this at https://github.com/bhuism/spring-ldap.

@hoalex
Copy link

hoalex commented Apr 9, 2017

I'm also observing this behaviour. Any chance to get this fixed?

@dustins
Copy link

dustins commented Oct 26, 2017

#469

I issued a pull request to fix this issue with findAll(Class<T> clazz)

@dustins
Copy link

dustins commented Oct 28, 2017

#470

Ok, if the API can't be changed for the foreseeable future, here is at least a fix so that the correct search is performed.

@jkeruzec
Copy link

jkeruzec commented May 3, 2018

Any idea when the pull request will be accepted ?

@barchiesi
Copy link

Will #470 ever get merged? If not, what would the recommended way of getting around the issue?

@jzheaux
Copy link
Contributor

jzheaux commented Jan 19, 2022

Should ObjectDirectoryMapper override the baseFilter when calling ObjectDirectoryMapper#filterFor

@lewisheadden, I don't think so. Ultimately, DirContext#search keeps the concepts of base and filter separate and Spring LDAP should probably preserve that in its API.

Or should we be checking for class annotations in https://github.com/spring-projects/spring-ldap/blob/master/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java#L1814?

This could work, though it seems to me that this work is already done in ObjectDirectoryMapper and it would be nice to maintain the abstraction so it can be switched out.

I'm inclined to introduce something that allows LdapTemplate to derive the base from ObjectDirectoryMapper, though I still wonder the right way to do it. LDAP 2.4's baseline is JDK 8, so adding an interface method to ObjectDirectoryMapper is now an option.

@mrahman-vf-ic-bd
Copy link

Any idea when the pull request will be accepted ?

@jzheaux jzheaux added this to the 3.3.x milestone Sep 30, 2024
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 a pull request may close this issue.

10 participants