Examples of toOneRelationshipKeys()


Examples of com.webobjects.eocontrol.EOClassDescription.toOneRelationshipKeys()

//            rel.put("sourceGlobalID", destination.get("gid"));
//            rel.put("relationshipName", key);
//            jsonValue = rel;
            jsonValue = null;
          }
        } else if (cd.toOneRelationshipKeys().containsObject(key)) {
          if (relationshipNames.containsObject(key)) {
            Object value = source.valueForKey(key);
            jsonValue = ser.marshall(state, source, value, key);
          }
          else {
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription.toOneRelationshipKeys()

              _addAttributeNodeForKeyInObject(remainingKey, obj, keyFilter);
            }
            else if (nonModelClassDescription.toManyRelationshipKeys().containsObject(keyName)) {
              _addToManyRelationshipNodeForKeyOfEntityInObject(remainingKey, nonModelClassDescription.classDescriptionForDestinationKey(keyName), obj, keyFilter, context, visitedObjects);
            }
            else if (nonModelClassDescription.toOneRelationshipKeys().containsObject(keyName)) {
              _addToOneRelationshipNodeForKeyInObject(remainingKey, obj, nonModelClassDescription.classDescriptionForDestinationKey(keyName), keyFilter, context, visitedObjects);
            }
            else if (nonModelClassDescription instanceof BeanInfoClassDescription && ((BeanInfoClassDescription) nonModelClassDescription).isAttributeMethod(keyName)) {
              _addAttributeNodeForKeyInObject(remainingKey, obj, keyFilter);
            }
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription.toOneRelationshipKeys()

          EOClassDescription destinationClassDescription;
          // this is sort of expensive, but we want to support non-eomodel to-one relationships on EO's, so
          // we fallback and lookup the class entity ...
          if (!classDescription.toOneRelationshipKeys().containsObject(keyName) && classDescription instanceof EOEntityClassDescription) {
            EOClassDescription nonModelClassDescription = ERXRestClassDescriptionFactory.classDescriptionForObject(obj, true);
            if (!nonModelClassDescription.toOneRelationshipKeys().containsObject(keyName)) {
              throw new IllegalArgumentException("There is no to-one relationship named '" + key.key() + "' on '" + classDescription.entityName() + "'.");
            }
            destinationClassDescription = nonModelClassDescription.classDescriptionForDestinationKey(keyName);
          }
          else {
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription.toOneRelationshipKeys()

        properties.setObjectForKey(property, key.key());
      }
    }

    for (String toOneRelationshipName : classDescription.toOneRelationshipKeys()) {
      ERXKey<Object> key = new ERXKey<Object>(toOneRelationshipName);
      if (filter.matches(key, ERXKey.Type.ToOneRelationship)) {
        EOClassDescription destinationClassDescription = classDescription.classDescriptionForDestinationKey(key.key());
        ERXKeyFilter destinationFilter = filter._filterForKey(key);
        NSDictionary<String, Object> destinationSchema = ERXRestSchema.schemaPropertiesForEntityNamed(destinationClassDescription.entityName(), destinationFilter, entities);
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription.toOneRelationshipKeys()

            EOEnterpriseObject eo = (EOEnterpriseObject)object;
            EOEditingContext ec = eo.editingContext();
            EOClassDescription cd = eo.classDescription();
            if (cd.attributeKeys().containsObject(key)) {
                value = NSKeyValueCodingAdditions.Utility.valueForKeyPath(eo, key);
            } else if (cd.toOneRelationshipKeys().containsObject(key)) {
                value = eo.valueForKeyPath(key);
            } else if (EOUtilities.entityNamed(ec, eo.entityName()).primaryKeyAttributeNames().containsObject(key)) {
                // when object is an EO and key is a cross-relationship keypath, we drop through to this case
                // and we'll fail.
                value = EOUtilities.primaryKeyForObject(ec,eo).objectForKey(key);
View Full Code Here

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

            String key = (String) iterator.next();
            if(!("javaClass".equals(key) || "gid".equals(key))) {
              Object value = eoDict.get(key);
              Object obj = ser.unmarshall(state, null, value);
              if (attributeNames.containsObject(key)) {
                if (obj == null && !relationshipNames.containsObject(key) && (eo.toOneRelationshipKeys().containsObject(key) || eo.toManyRelationshipKeys().containsObject(key))) {
                  // ignore nulls for non-included relationships
                }
                else {
                  eo.takeValueForKey(obj, key);
                }
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.