Examples of relationshipNamed()


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

    if (aKey != null) {
      String anEntityName = entityName();
      EOEntity anEntity = EOModelGroup.defaultGroup().entityNamed(
          anEntityName);
      EORelationship aRelationship = anEntity.relationshipNamed(aKey);

      if (aRelationship != null) {
        EOEditingContext anEditingContext = editingContext();
        EOGlobalID aGlobalID = anEditingContext.globalIDForObject(this);
        String aModelName = anEntity.model().name();
View Full Code Here

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

    public String valueClassNameForKey(String key) {
        String entityName = (String) _WOJExtensionsUtil.valueForBindingOrNull("sourceEntityName", this);
        EOModelGroup modelGroup = EOModelGroup.defaultGroup();
        EOEntity entity = modelGroup.entityNamed(entityName);
        EOAttribute selectedAttribute = null;
        if (relationshipKey() != null && entity.relationshipNamed(relationshipKey()) != null) {
            EORelationship relationship = entity.relationshipNamed(relationshipKey());
            EOEntity destinationEntity = relationship.destinationEntity();
            selectedAttribute = destinationEntity.attributeNamed(key);
        } else {
            selectedAttribute = entity.attributeNamed(key);
View Full Code Here

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

        String entityName = (String) _WOJExtensionsUtil.valueForBindingOrNull("sourceEntityName", this);
        EOModelGroup modelGroup = EOModelGroup.defaultGroup();
        EOEntity entity = modelGroup.entityNamed(entityName);
        EOAttribute selectedAttribute = null;
        if (relationshipKey() != null && entity.relationshipNamed(relationshipKey()) != null) {
            EORelationship relationship = entity.relationshipNamed(relationshipKey());
            EOEntity destinationEntity = relationship.destinationEntity();
            selectedAttribute = destinationEntity.attributeNamed(key);
        } else {
            selectedAttribute = entity.attributeNamed(key);
        }
View Full Code Here

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

                lastKey=KeyValuePath.lastPropertyKeyInKeyPath(key);
            }
        }
        if (entity!=null && lastKey!=null) {
            Object property=entity.attributeNamed(lastKey);
            property=property==null ? entity.relationshipNamed(lastKey) : property;
            //BOOGIE
            EOAttribute a=entity.attributeNamed(lastKey);
            NSDictionary userInfo=null;
            if (a!=null) userInfo=a.userInfo();
            else {
View Full Code Here

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

            //BOOGIE
            EOAttribute a=entity.attributeNamed(lastKey);
            NSDictionary userInfo=null;
            if (a!=null) userInfo=a.userInfo();
            else {
                EORelationship r=entity.relationshipNamed(lastKey);
                if (r!=null) userInfo=r.userInfo();
            }
            //
           // NSDictionary userInfo=(NSDictionary)(property!=null ? property.valueForKey("userInfo") : null);
            result= (String)(userInfo!=null ? userInfo.valueForKey("unit") : null);
View Full Code Here

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

        String key = null;
        EOEntity result = entity;

        while (keysEnumerator.hasMoreElements()) {
            key = (String) keysEnumerator.nextElement();
            result = result.relationshipNamed(key).destinationEntity();
        }

        return result;
    }
View Full Code Here

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

                }
            }
            // In the case we have a self join relationship we have to be more clever
            if(_destinationRelationship==null){
                EOEntity originEntity = EOModelGroup.defaultGroup().entityNamed(originEntityName);
                EORelationship originRelationship = originEntity.relationshipNamed(relationshipKey());
                EORelationship inverseOriginRelationship = originRelationship.inverseRelationship();
                for (Enumeration e=joinRelationships.objectEnumerator(); e.hasMoreElements();) {
                    EORelationship r=(EORelationship)e.nextElement();
                    if (r!=inverseOriginRelationship) {
                        _destinationRelationship=r;
View Full Code Here

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

   
    Collections.addAll(splits, DOT_PATTERN.split(keypath));
   
    for (int i=0; i<splits.size(); i++) {
      String key = splits.get(i);
      EORelationship rel = currentEntity.relationshipNamed(key);
     
      if (rel != null) {       
        if (rel.isFlattened()) {
          String [] newDefinition = DOT_PATTERN.split(rel.definition());
         
View Full Code Here

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

            } else if(s.indexOf(RELATIONSHIP_PREFIX) == 0) {
                int entityOffset = s.indexOf(ENTITY_PREFIX);
                String entityName = s.substring(entityOffset + ENTITY_PREFIX.length());
                String relationshipName = s.substring(RELATIONSHIP_PREFIX.length(), entityOffset);
                EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName);
                o = entity.relationshipNamed(relationshipName);
            } else if(s.indexOf(ATTRIBUTE_PREFIX) == 0) {
                int entityOffset = s.indexOf(ENTITY_PREFIX);
                String entityName = s.substring(entityOffset + ENTITY_PREFIX.length());
                String attributeName = s.substring(ATTRIBUTE_PREFIX.length(), entityOffset);
                EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName);
View Full Code Here

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

    EOEntity currentEntity = entity;
    String [] splits = key.split("\\.");
    Collection<EORelationship> rels = new ArrayList<EORelationship>();
   
    for (int i=0; i<splits.length - 1; i++) {
      EORelationship rel = currentEntity.relationshipNamed(splits[i]);
     
      rels.add(rel);
      currentEntity = rel.destinationEntity();
    }
   
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.