Examples of relationshipNamed()


Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

  public NSArray referenceEOs() {
    if (_referenceEOs == null) {
      String relationshipName = (String) d2wContext().valueForKey("referenceRelationshipForBackgroupColor");
      if (relationshipName != null) {
        EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName());
        EORelationship relationship = entity.relationshipNamed(relationshipName);
        _referenceEOs = EOUtilities.objectsForEntityNamed(EOSharedEditingContext.defaultSharedEditingContext(), relationship.destinationEntity().name());
        _referenceEOs = ERXArrayUtilities.sortedArraySortedWithKey(_referenceEOs, "ordering", EOSortOrdering.CompareAscending);
      }
    }
    return _referenceEOs;
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

                    lastEO=rawLastEO instanceof EOEnterpriseObject ? (EOEnterpriseObject)rawLastEO : null;
                }
                if (lastEO!=null) {
                    EOEntity entity=EOModelGroup.defaultGroup().entityNamed(lastEO.entityName());
                    String lastKey=KeyValuePath.lastPropertyKeyInKeyPath(propertyKey);
                    result=entity.relationshipNamed(lastKey);
                }
            }
            if (result==null) {
                // working around D2W bug
                result=c.relationship();
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

          + object.storedValueForKey(relationshipName).getClass().getName(), e);
    }
   
    final EOEditingContext ec = object.editingContext();
    EOEntity entity = ERXEOAccessUtilities.entityForEo(object);
    EORelationship relationship = entity.relationshipNamed(relationshipName);

    // Fail in the event that the relationship fault is not a toMany
    if (!relationship.isToMany()) {
      // Happens if toOne key used and the to-one is a fault
      throw new IllegalArgumentException("The attribute named '" + relationshipName
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

                }
                if (lastEO!=null) {
                    // FIXME: Should be using the model group from the ec of the lastEO.
                    EOEntity entity=EOModelGroup.defaultGroup().entityNamed(lastEO.entityName());
                    String lastKey=KeyValuePath.lastPropertyKeyInKeyPath(propertyKey);
                    result=entity.relationshipNamed(lastKey);
                }
            }
            if (result==null) {
                result=c.relationship();
                log.warn(propertyKey + "-" + rawObject);
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

    Retriever<? extends PropertyContainer, V> lastRetriever;
   
    // iterate over splits except for the last one
    for (int i=0; i<splits.length-1; i++) { 
      String key = splits[i];
      EORelationship rel = current.relationshipNamed(key);
      RelationshipRetriever<? extends PropertyContainer, ? extends PropertyContainer> r = RelationshipRetriever.create(rel);
     
      interimRetrievers.add(r);
     
      current = rel.destinationEntity();
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

    }
   
    // now handle last one (which could be attribute or relationship)
    {
      String key = splits[splits.length - 1];
      EORelationship rel = current.relationshipNamed(key);
     
      if (rel != null) {
        lastRetriever = (Retriever<? extends PropertyContainer, V>) RelationshipRetriever.create(rel);       
      } else {
        EOAttribute att = current.attributeNamed(key);
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

                lastEO=rawLastEO instanceof EOEnterpriseObject ? (EOEnterpriseObject)rawLastEO : null;
            }
            if (lastEO!=null) {
                EOEntity entity=EOModelGroup.defaultGroup().entityNamed(lastEO.entityName());
                String lastKey=KeyValuePath.lastPropertyKeyInKeyPath(propertyKey);
                result=entity.relationshipNamed(lastKey);
            }
        }
        if (result==null && propertyKey!=null) {
      // working around D2W bug
            result=c.relationship();
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

        return _detailDataSource;
    }

    public EORelationship entityRelationship() {
        EOEntity e = EOModelGroup.defaultGroup().entityNamed(object().entityName());
        EORelationship result=e.relationshipNamed(key());
        if (result==null)
            throw new RuntimeException("Could not find relationship for entity "+object().entityName()+" - "+key());
        return result;
    }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

            return valueForKeyPath(restrictedChoiceKey);
        String fetchSpecName=(String)d2wContext().valueForKey("restrictingFetchSpecification");
        if(fetchSpecName != null) {
            EOEditingContext ec = ERXEC.newEditingContext();
            EOEntity entity = d2wContext().entity();
            EORelationship relationship = entity.relationshipNamed((String)d2wContext().valueForKey("propertyKey"));
            return EOUtilities.objectsWithFetchSpecificationAndBindings(ec, relationship.destinationEntity().name(),fetchSpecName,null);
        }
        return null;
    }
}
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.relationshipNamed()

        }
        String fetchSpecName = (String) d2wContext().valueForKey("restrictingFetchSpecification");
        if (fetchSpecName != null) {
            EOEditingContext ec = ERXEC.newEditingContext();
            EOEntity entity = d2wContext().entity();
            EORelationship relationship = entity.relationshipNamed((String) d2wContext().valueForKey("propertyKey"));
            ec.lock();
            try {
                return EOUtilities.objectsWithFetchSpecificationAndBindings(ec,
                        relationship.destinationEntity().name(), fetchSpecName, null);
            } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.