Package er.extensions.eof

Examples of er.extensions.eof.ERXFetchSpecification


    EOEntity joinEntity = toJoinRelationship.destinationEntity();
    EREntityStore joinStore = context._entityStoreForEntity(joinEntity);
    String sourceAttribute = toJoinRelationship.sourceAttributes().get(0).name();
    String destinationAttribute = toJoinRelationship.destinationAttributes().get(0).name();

    ERXFetchSpecification fs = new ERXFetchSpecification(joinEntity.name(), ERXQ.equals(destinationAttribute,
        row.valueForKey(sourceAttribute)), null);
    NSArray<NSMutableDictionary<String, Object>> fetchedObjects = joinStore.fetch(joinEntity.attributesToFetch(),
        fs, false, joinEntity, context);

    if (fetchedObjects.isEmpty()) {
      return NSArray.EmptyArray;
    }

    EORelationship destRelationship = joinEntity.anyRelationshipNamed(toDestKey);
    sourceAttribute = destRelationship.sourceAttributes().get(0).name();
    destinationAttribute = destRelationship.destinationAttributes().get(0).name();
    NSArray<Object> destValues = (NSArray<Object>) fetchedObjects.valueForKey(sourceAttribute);
    EOEntity destEntity = relationship.destinationEntity();

    fs = new ERXFetchSpecification(destEntity.name(), ERXQ.in(destinationAttribute, destValues), null);
    EREntityStore destinationStore = context._entityStoreForEntity(destEntity);
    fetchedObjects = destinationStore.fetch(destEntity.attributesToFetch(), fs, false, destEntity, context);

    return fetchedObjects;
  }
View Full Code Here


    EOEntity destEntity = relationship.destinationEntity();
    EREntityStore destStore = context._entityStoreForEntity(destEntity);
    String sourceAttribute = relationship.sourceAttributes().get(0).name();
    String destinationAttribute = relationship.destinationAttributes().get(0).name();

    ERXFetchSpecification fs = new ERXFetchSpecification(destEntity.name(), ERXQ.equals(destinationAttribute,
        row.valueForKey(sourceAttribute)), null);
    return destStore.fetch(destEntity.attributesToFetch(), fs, false, destEntity, context);
  }
View Full Code Here

TOP

Related Classes of er.extensions.eof.ERXFetchSpecification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.