Commit 1119b49
committed
Fix projection query field mapping issue
When using projection queries with entities that have @Attribute annotations
for LDAP field mapping, the query was using Java field names instead of
the mapped LDAP attribute names. This caused queries to fail when the
Java field name differs from the LDAP attribute name.
Changes:
- Modified LdapQueryCreator to map projection fields using
ObjectDirectoryMapper.attributeFor() method
- Updated test assertions to verify correct LDAP attribute names
are used in queries (e.g., "sn" instead of "lastName")
Example: For an entity field 'groupId' mapped to LDAP attribute
'gidNumber' via @Attribute annotation, projection queries now
correctly use 'gidNumber' in the LDAP query.
Fixes projection queries for entities with custom LDAP attribute mappings.1 parent 41ff966 commit 1119b49
File tree
2 files changed
+5
-4
lines changed- src
- main/java/org/springframework/data/ldap/repository/query
- test/java/org/springframework/data/ldap/repository
2 files changed
+5
-4
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
0 commit comments