Examples of relationshipNamed()


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

                from=(EOEnterpriseObject)from.valueForKeyPath(partialKeyPath);
                keyPath=ERXStringUtilities.lastPropertyKeyInKeyPath(keyPath);
            }
            //if the key is not a keyPath we can check if the key is actually a relationship
            EOEntity e=ERXEOAccessUtilities.entityNamed(from.editingContext(), from.entityName());
            EORelationship r=e.relationshipNamed(keyPath);
            if (r!=null) //if the key correspond to a relationship
                from.addObjectToBothSidesOfRelationshipWithKey(to, keyPath);
            else
                from.takeValueForKeyPath(to,keyPath);
        }
View Full Code Here

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

        if (entity!=null && lastKey!=null) {
            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();
            }
            result= (String)(userInfo!=null ? userInfo.valueForKey("unit") : null);
        }
        return result;
View Full Code Here

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

            }

            Enumeration partialRelationships = partialExtensionEntity.relationships().objectEnumerator();
            while (partialRelationships.hasMoreElements()) {
              EORelationship partialRelationship = (EORelationship) partialRelationships.nextElement();
              if (partialEntity.relationshipNamed(partialRelationship.name()) == null) {
                NSMutableDictionary<String, Object> relationshipPropertyList = new NSMutableDictionary<String, Object>();
                partialRelationship.encodeIntoPropertyList(relationshipPropertyList);

                EORelationship primaryRelationship = new EORelationship(relationshipPropertyList, partialEntity);
                primaryRelationship.awakeWithPropertyList(relationshipPropertyList);
View Full Code Here

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

        if (_parentList==null) {
            // FIXME this list should be shared with all other JSTwoLevel.. sharing the same sourceEntityName!
            String entityName=(String)valueForBinding("sourceEntityName");
            EOEditingContext ec=((EOEnterpriseObject)valueForBinding("sourceObject")).editingContext();
            EOEntity sourceEntity=EOUtilities.entityNamed(ec,entityName);
            EORelationship r1=sourceEntity.relationshipNamed((String)valueForBinding("relationshipKey"));
            EOEntity childEntity=r1.destinationEntity();
            EORelationship r2= childEntity.relationshipNamed((String)valueForBinding("restrictingRelationshipKey"));
            EOEntity parentEntity=r2.destinationEntity();
            NSArray unsortedList=EOUtilities.objectsForEntityNamed(ec,parentEntity.name());
            EOSortOrdering sortOrdering=new EOSortOrdering((String)valueForBinding("restrictingRelationshipSortKey"),
View Full Code Here

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

            String entityName=(String)valueForBinding("sourceEntityName");
            EOEditingContext ec=((EOEnterpriseObject)valueForBinding("sourceObject")).editingContext();
            EOEntity sourceEntity=EOUtilities.entityNamed(ec,entityName);
            EORelationship r1=sourceEntity.relationshipNamed((String)valueForBinding("relationshipKey"));
            EOEntity childEntity=r1.destinationEntity();
            EORelationship r2= childEntity.relationshipNamed((String)valueForBinding("restrictingRelationshipKey"));
            EOEntity parentEntity=r2.destinationEntity();
            NSArray unsortedList=EOUtilities.objectsForEntityNamed(ec,parentEntity.name());
            EOSortOrdering sortOrdering=new EOSortOrdering((String)valueForBinding("restrictingRelationshipSortKey"),
                                                           EOSortOrdering.CompareAscending);
            NSMutableArray sortArray=new NSMutableArray(sortOrdering);
View Full Code Here

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

        Enumeration keysEnumerator = keys.objectEnumerator();
        String key=null;
        EOEntity result=entity;
        while (keysEnumerator.hasMoreElements()) {
            key = (String)keysEnumerator.nextElement();
            result = result.relationshipNamed(key).destinationEntity();
        }
        return result;
    }

    protected EODataSource _localDataSource() {
View Full Code Here

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

        EORelationship relationship = null;
       
        if (lastEO!=null) {
            EOEntity entity=ERXEOAccessUtilities.entityNamed(object.editingContext(), lastEO.entityName());
            String lastKey=ERXStringUtilities.lastPropertyKeyInKeyPath(keyPath);
            relationship=entity.relationshipNamed(lastKey);
        }
        return relationship;
    }

   
View Full Code Here

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

        EODataSource ds = dataSource();
        if (ds!= null && ds instanceof EODetailDataSource) {
          EODetailDataSource dds = (EODetailDataSource)ds;
          EOEnterpriseObject masterObj = (EOEnterpriseObject)dds.masterObject();
          EOEntity masterEntity = ERXEOAccessUtilities.entityForEo(masterObj);
          EORelationship relationship = masterEntity.relationshipNamed(dds.detailKey());
          EORelationship reverseRelationship = relationship.inverseRelationship();
          if(isRemoveable) {
            if(reverseRelationship == null) {
              _showRemoveButton = Boolean.TRUE;
            } else {
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.