Retrieve All ODM-Managed Attributes on Update
In this way, if an Entry has an operational attribute, it will be present in both the updated and existing objects so that DirContextAdapter does not compute it as a new attribute. Closes gh-446
This commit is contained in:
@@ -1674,12 +1674,18 @@ public class LdapTemplate implements LdapOperations, InitializingBean {
|
||||
|
||||
Assert.notNull(id, String.format("Unable to determine id for entry %s", entry.toString()));
|
||||
|
||||
DirContextOperations context = lookupContext(id);
|
||||
String[] attributes = this.odm.manageClass(entry.getClass());
|
||||
DirContextAdapter context = lookup(id, attributes, cast());
|
||||
context.setUpdateMode(true);
|
||||
this.odm.mapToLdapDataEntry(entry, context);
|
||||
modifyAttributes(context);
|
||||
}
|
||||
}
|
||||
|
||||
private <T> ContextMapper<T> cast() {
|
||||
return (ctx) -> (T) ctx;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user