Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1830,8 +1830,10 @@ public <T> List<T> find(Name base, Filter filter, SearchControls searchControls,
}

// extend search controls with the attributes to return
String[] attributes = odm.manageClass(clazz);
searchControls.setReturningAttributes(attributes);
if (isNotCustomReturningAttributes(searchControls)) {
String[] attributes = this.odm.manageClass(clazz);
searchControls.setReturningAttributes(attributes);
}

if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Searching - base=%1$s, finalFilter=%2$s, scope=%3$s", base, finalFilter, searchControls));
Expand Down Expand Up @@ -1877,6 +1879,10 @@ else if (result.size() != 1) {

return result.get(0);
}

private boolean isNotCustomReturningAttributes(SearchControls searchControls) {
return searchControls.getReturningAttributes() == null || searchControls.getReturningAttributes().length == 0;
}

/**
* The status of an authentication attempt.
Expand Down