ERXRestRequestNode toManyRelationshipNode = new ERXRestRequestNode(keyFilter.keyMap(key).key(), false);
toManyRelationshipNode.setArray(true);
toManyRelationshipNode.setType(destinationEntity.entityName());
List childrenObjects = (List) key.valueInObject(obj);
ERXKeyFilter childFilter = keyFilter._filterForKey(key);
if (childFilter.isDistinct()) {
if (childrenObjects instanceof NSArray) {
childrenObjects = ERXArrayUtilities.distinct((NSArray<?>) childrenObjects);
} else {
childrenObjects = new ArrayList(new HashSet(childrenObjects));
}
}
NSArray<EOSortOrdering> sortOrderings = childFilter.sortOrderings();
if (sortOrderings != null && sortOrderings.count() > 0) {
if (childrenObjects instanceof NSArray) {
childrenObjects = EOSortOrdering.sortedArrayUsingKeyOrderArray((NSArray<?>)childrenObjects, sortOrderings);
}
else {