You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a POJO class that contains LDAP attributes. The class is annotated with @Entry annotation. The entity has some fields as a collection (i.e. Set<String>) but most of the POJO fields are just String values.
When I try to use LdapRepository's findAll method with Predicate to search through multi-valued fields with using Collection.contains(...) method the spring-data-ldap throws the exception:
java.lang.UnsupportedOperationException: Unsupported operator IN
at org.springframework.data.ldap.repository.support.LdapSerializer.visit(LdapSerializer.java:108)
at org.springframework.data.ldap.repository.support.LdapSerializer.visit(LdapSerializer.java:37)
at com.querydsl.core.types.OperationImpl.accept(OperationImpl.java:83)
I was able to trace the problem and it looks like when Collection type of an attribute is used for a Predicate's query then QueryDSL provides IN operation which is not supported by Spring's LdapSerializer class.
Here is the sample of the Predicate:
QPerson person = QPerson.person;
return person.studentAliases.contains(alias).or(person.employeeAliases.contains(alias));
Is it possible to add support for IN operation same way as EQ operator so DATA-LDAP module processes multi-valued attributes without any issues?
Alex opened DATALDAP-62 and commented
I have a POJO class that contains LDAP attributes. The class is annotated with
@Entry
annotation. The entity has some fields as a collection (i.e. Set<String>) but most of the POJO fields are just String values.When I try to use LdapRepository's findAll method with Predicate to search through multi-valued fields with using Collection.contains(...) method the spring-data-ldap throws the exception:
I was able to trace the problem and it looks like when Collection type of an attribute is used for a Predicate's query then QueryDSL provides IN operation which is not supported by Spring's LdapSerializer class.
Here is the sample of the Predicate:
Is it possible to add support for IN operation same way as EQ operator so DATA-LDAP module processes multi-valued attributes without any issues?
No further details from DATALDAP-62
The text was updated successfully, but these errors were encountered: