sortOrderings = fetchSpecification.sortOrderings();
}
if (entity.restrictingQualifier() != null) {
if (qualifier != null) {
qualifier = new EOAndQualifier(new NSArray(new EOQualifier[] { qualifier, entity.restrictingQualifier() }));
} else {
qualifier = entity.restrictingQualifier();
}
}
NSMutableArray<EORelationship> mergeRelationships = new NSMutableArray<EORelationship>();
if (qualifier != null && context != null) {
NSArray<EOKeyValueQualifier> keyValueQualifiers = ERXQ.extractKeyValueQualifiers(qualifier);
for (EOKeyValueQualifier keyValueQualifier : keyValueQualifiers) {
String qualifierKey = keyValueQualifier.key();
String relationshipName = qualifierKey;
if (relationshipName.contains(".")) {
relationshipName = ERXStringUtilities.firstPropertyKeyInKeyPath(relationshipName);
}
EORelationship mergeRelationship = entity.relationshipNamed(relationshipName);
if (mergeRelationship != null) {
mergeRelationships.add(mergeRelationship);
qualifier = ERXQ.replaceQualifierWithQualifier(qualifier, keyValueQualifier,
ERXQ.has(qualifierKey, new NSArray(keyValueQualifier.value())));
} else if (qualifierKey.equals(entity.primaryKeyAttributeNames().get(0))
&& keyValueQualifier.selector().name().equals("doesContain") && !(keyValueQualifier.value() instanceof NSArray)) {
// fix wrong schemaBasedQualifier
qualifier= ERXQ.replaceQualifierWithQualifier(qualifier, keyValueQualifier,
ERXQ.is(qualifierKey, keyValueQualifier.value()));