-
Notifications
You must be signed in to change notification settings - Fork 55
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 support for parametrized @Query
#453
Comments
@Query
Parameters from the method call aren't incorporated in Also, adding SpEL support would make sense as well. |
I wrote my own repository class to be able to individually change the base on each query. Is there a way to write the objectClass check in a shorter way? e.g.
@mp911de As I wrote in my 1st post. It is possible pass a numbered parameter into value argument with |
It's not supported reliably. Parameter evaluation happens in Spring LDAP's Parameters are encoded using System.out.println(LdapEncoder.filterEncode("*")); produces:
|
We want to extend parametrization capabilities by allowing:
The previous form of |
I'm trying to build a filter using
@Query
in myLdapRepository
class that uses a parameter and the parameter most likely contains '*'.The queries are successful when using a parameter
cn
without wildcard '*'. I'm expecting one entry and I' getting one result. Log output:finalFilter=(&(&(objectclass=top)(objectclass=group))(cn=us_dbl_ci_user_grp))
When trying to add '*' to query-parameter
cn
the result is always empty. Log output:finalFilter=(&(&(objectclass=top)(objectclass=group))(cn=us_ci_\2a))
Is this behavior intended, is it a bug or am I doing something wrong?
Just in case I'm trying to explain what I try to achieve with my code:
My main goal is to narrow down the ldap base for this to different queries.
I set the ldap base in my entry class to the upper 'folder' in the ldap hierarchy.
@Entry(base="OU=gruppen,OU=MYORG", objectClasses = {"top", "group"})
Because this path contains >1000 subfolders and because I know exactly which subfolder I want to query, I narrow it down when I define the
@Query
(btw: it would be great to use params like {1} for base as well)@Query( base = "OU=jenkins,OU=gruppen,OU=MYORG", searchScope = SearchScope.SUBTREE, value = "(cn={0})")
@Query( base = "OU=itsqs,OU=gruppen,OU=MYORG", searchScope = SearchScope.SUBTREE, value = "(cn={0})")
If I'm on the wrong path, please give me some advise, how to do this query the correct way. THX
The text was updated successfully, but these errors were encountered: