Examples of editingContext()


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

        private void traverseForHomogeniousObjects(NSArray sourceObjects, boolean skipFaultedSourceObjects) {
            if (sourceObjects == null || sourceObjects.count() < 1) return;

            EOEnterpriseObject eo = (EOEnterpriseObject) sourceObjects.objectAtIndex(0);
            EOEditingContext ec = eo.editingContext();
            EOEntity entity = EOUtilities.entityForObject(ec, eo);

            EORelationship relationship = entity.relationshipNamed(path);

            if (relationship == null) return;
View Full Code Here

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

        }

        private void batchFetchRelationshipOnSourceObjects(EORelationship relationship, NSArray sourceObjects, boolean skipFaultedSourceObjects) {

            EOEnterpriseObject eo = (EOEnterpriseObject) sourceObjects.objectAtIndex(0);
            EOEditingContext ec = eo.editingContext();

            if (log.isDebugEnabled()) {
              log.debug("Batch fetching '" + path + "' relationship on " + sourceObjects);
            }
View Full Code Here

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

    public boolean evaluateWithObject(Object object) {
        Object value = null;
        String key = key();
        if(object instanceof EOEnterpriseObject) {
            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);
View Full Code Here

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

                        NSDictionary dict =  null;
                        String currentKey = (String) destinationAttibuteNames.objectAtIndex(j);
                        Object v;
                        if (o instanceof EOEnterpriseObject) {
                            EOEnterpriseObject eoenterpriseobject = (EOEnterpriseObject)o;
                            EOObjectStoreCoordinator osc = ((EOObjectStoreCoordinator)eoenterpriseobject.editingContext().rootObjectStore());
                            dict = osc.valuesForKeys(new NSArray(currentKey), eoenterpriseobject);
                            v = dict.objectForKey(currentKey);
                         } else {
                            v = o;
                         }
View Full Code Here

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

    @Override
    public boolean evaluateWithObject(Object object) {
        Object value = null;
        if(object instanceof EOEnterpriseObject) {
            EOEnterpriseObject eo = (EOEnterpriseObject)object;
            EOEditingContext ec = eo.editingContext();
            if(eo.classDescription().attributeKeys().containsObject(key())) {
                value = NSKeyValueCodingAdditions.Utility.valueForKeyPath(eo, 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.
View Full Code Here

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

    if (object == null) {
      hashCode = 0;
    }
    else if (eoSupport(component) && object instanceof EOEnterpriseObject) {
      EOEnterpriseObject eo = (EOEnterpriseObject)object;
      EOEditingContext editingContext = eo.editingContext();
      EOGlobalID gid = null;
      if (editingContext != null) {
        gid = editingContext.globalIDForObject(eo);
      }
      // If the EO isn't in an EC, or it has a null GID, then just fall back to the hash code
View Full Code Here

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

  public void deleteObjects(NSArray objects) {
    for (int i = objects.count(); i-- > 0;) {
      Object o = objects.objectAtIndex(i);
      if (o instanceof EOEnterpriseObject) {
        EOEnterpriseObject eo = (EOEnterpriseObject) o;
        if (eo.editingContext() != null) {
          eo.editingContext().deleteObject(eo);
        }
      }
    }
  }
View Full Code Here

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

    for (int i = objects.count(); i-- > 0;) {
      Object o = objects.objectAtIndex(i);
      if (o instanceof EOEnterpriseObject) {
        EOEnterpriseObject eo = (EOEnterpriseObject) o;
        if (eo.editingContext() != null) {
          eo.editingContext().deleteObject(eo);
        }
      }
    }
  }
View Full Code Here

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

            if(contextID != null)
                page = session().restorePageForContextID(contextID);
            log.debug("Page: " + (page != null ? "Yes" : "No"));
            if(page != null && true) {
                eo = (EOEnterpriseObject)page.valueForKey("object");
                eo.editingContext().lock();
                int dotOffset = key.lastIndexOf('.');
                if(dotOffset > 0) {
                    Object otherEO = eo.valueForKeyPath(key.substring(0, dotOffset));
                    if(otherEO != null) {
                        NSValidation.Utility.validateValueForKey(otherEO, value, key.substring(dotOffset+1));
View Full Code Here

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

                _errors = ex1.toString();
            }
        } catch (NSValidation.ValidationException ex1) {
            _errors = ex1.getMessage();
        } finally {       
            if (eo != null && eo.editingContext() != null) {
                eo.editingContext().unlock();
            }
        }
    }
   
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.