Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOEnterpriseObject.valueForKey()


        EOEditingContext ec = ERXEC.newEditingContext();
        ec.lock();
        try {
            EOEnterpriseObject pref = preferenceRecordForKey(key, ec);
            if (pref != null) {
                String encodedValue = (String)pref.valueForKey("value");
                if(encodedValue !=null) {
                    result = decodedValue(encodedValue);
                }
            }
        } catch(RuntimeException ex) {
View Full Code Here


            EOEnterpriseObject pref = preferenceRecordForKey(key, ec);
            ERCoreUserInterface u = (ERCoreUserInterface)ERCoreBusinessLogic.actor(ec);
            if (pref != null) {
                if (value != null) {
                    String encodedValue = encodedValue(value);
                    if (ObjectUtils.notEqual(encodedValue, pref.valueForKey("value"))) {
                        if (log.isDebugEnabled())
                            log.debug("Updating preference "+u+": "+key+"="+encodedValue);
                        pref.takeValueForKey(encodedValue,"value");
                    }
                } else {
View Full Code Here

            if(realSourceObject instanceof EOEnterpriseObject) {
                EOEnterpriseObject eo = (EOEnterpriseObject)realSourceObject;
                if(value instanceof EOEnterpriseObject) {
                    eo.addObjectToBothSidesOfRelationshipWithKey((EOEnterpriseObject)value, realRelationshipKey);
                } else {
                    Object oldValue = eo.valueForKey(realRelationshipKey);
                    if(oldValue instanceof EOEnterpriseObject) {
                        eo.removeObjectFromBothSidesOfRelationshipWithKey((EOEnterpriseObject)oldValue, realRelationshipKey);
                    } else {
                        //  handle attributes
                        eo.takeValueForKey(value, realRelationshipKey);
View Full Code Here

            Enumeration e = sourceObjects.objectEnumerator();
            while (e.hasMoreElements()) {
                EOEnterpriseObject nextEO = (EOEnterpriseObject) e.nextElement();

                if (relationship.isToMany()) {
                    destinationObjects.addObjectsFromArray((NSArray) nextEO.valueForKey(path));
                } else {
                    Object o = nextEO.valueForKey(path);
                    if (o != null) destinationObjects.addObject(o);

                }
View Full Code Here

                EOEnterpriseObject nextEO = (EOEnterpriseObject) e.nextElement();

                if (relationship.isToMany()) {
                    destinationObjects.addObjectsFromArray((NSArray) nextEO.valueForKey(path));
                } else {
                    Object o = nextEO.valueForKey(path);
                    if (o != null) destinationObjects.addObject(o);

                }
            }
View Full Code Here

    newValues = newValues != null ? newValues : NSArray.EmptyArray;

    if (realSourceObject instanceof EOEnterpriseObject && // only add/remove if we have an EO and handle a relationship
        ((EOEnterpriseObject) realSourceObject).classDescriptionForDestinationKey(realRelationshipKey) != null) {
      EOEnterpriseObject eo = (EOEnterpriseObject) realSourceObject;
      NSArray currentValues = (NSArray) eo.valueForKey(realRelationshipKey);
      currentValues = currentValues != null ? currentValues : NSArray.EmptyArray;

      for (int i = currentValues.count() - 1; i >= 0; i--) {
        EOEnterpriseObject o = (EOEnterpriseObject) currentValues.objectAtIndex(i);
        if (newValues.indexOfIdenticalObject(o) == NSArray.NotFound) { // not found
View Full Code Here

    }

    public EOEnterpriseObject selectedParent() {
        EOEnterpriseObject selectedChild=selectedChild();
        return selectedChild!=null ?
            (EOEnterpriseObject)selectedChild.valueForKey((String)valueForBinding("restrictingRelationshipKey")) : null;
    }
    public void setSelectedParent(EOEnterpriseObject newValue) { // FIXME
        // do nothing, there is always a setSelectedChild with the JS subcomponent
    }
    public EOEnterpriseObject selectedChild() {
View Full Code Here

        if (anEO != null) {

            if (isDictionary) {
                _dictionary.setObjectForKey(anEO, masterKey);
            }
            else if (_eo.valueForKey(masterKey) != anEO) {
                _eo.addObjectToBothSidesOfRelationshipWithKey((EOEnterpriseObject) anEO, masterKey);
            }

        }
        else { // remove
View Full Code Here

        else { // remove

            if (isDictionary) {
                _dictionary.removeObjectForKey(masterKey);
            }
            else if (_eo.valueForKey(masterKey) != null) {
                _eo.removeObjectFromBothSidesOfRelationshipWithKey((EOEnterpriseObject) _eo.valueForKey(masterKey), masterKey);
            }

        }
View Full Code Here

            if (isDictionary) {
                _dictionary.removeObjectForKey(masterKey);
            }
            else if (_eo.valueForKey(masterKey) != null) {
                _eo.removeObjectFromBothSidesOfRelationshipWithKey((EOEnterpriseObject) _eo.valueForKey(masterKey), masterKey);
            }

        }

    }
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.