Skip to content

Commit

Permalink
feat: handle multivalued in search by example in CB ORM #2297
Browse files Browse the repository at this point in the history
  • Loading branch information
yurem committed Sep 2, 2022
1 parent 35bb8c4 commit 1ac1ea5
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,29 +172,33 @@ public void setUserPassword(String value) {
setCustomAttribute("userPassword", value);
}

public void setAttribute(String attributeName, String[] attributeValue) {
setCustomAttribute(attributeName, Arrays.asList(attributeValue));
public CustomObjectAttribute setAttribute(String attributeName, String[] attributeValue) {
return setCustomAttribute(attributeName, Arrays.asList(attributeValue));
}

public void setAttribute(String attributeName, String attributeValue) {
public CustomObjectAttribute setAttribute(String attributeName, String attributeValue) {
if (attributeValue == null || attributeValue.length() == 0) {
setCustomAttribute(attributeName, Collections.emptyList());
return setCustomAttribute(attributeName, Collections.emptyList());
} else {
setCustomAttribute(attributeName, attributeValue);
return setCustomAttribute(attributeName, attributeValue);
}
}

public void setCustomAttribute(String attributeName, Object attributeValue) {
public CustomObjectAttribute setCustomAttribute(String attributeName, Object attributeValue) {
CustomObjectAttribute attribute = new CustomObjectAttribute(attributeName, attributeValue);
typedCustomAttributes.remove(attribute);
typedCustomAttributes.add(attribute);

return attribute;
}

public void setCustomAttribute(String attributeName, List<Object> attributeValue) {
public CustomObjectAttribute setCustomAttribute(String attributeName, List<Object> attributeValue) {
CustomObjectAttribute attribute = new CustomObjectAttribute(attributeName, attributeValue);
attribute.setMultiValued(true);
typedCustomAttributes.remove(attribute);
typedCustomAttributes.add(attribute);

return attribute;
}

}

0 comments on commit 1ac1ea5

Please sign in to comment.