Examples of lastObject()


Examples of com.webobjects.foundation.NSArray.lastObject()

    if (valueArray.count() == 0) {
      return "0=1";
    }
    StringBuilder sb = new StringBuilder();
    NSArray attributePath = ERXEOAccessUtilities.attributePathForKeyPath(e.entity(), key);
    EOAttribute attribute = (EOAttribute) attributePath.lastObject();
    String sqlName;
    if (attributePath.count() > 1) {
      sqlName = e.sqlStringForAttributePath(attributePath);
    }
    else {
View Full Code Here

Examples of com.webobjects.foundation.NSArray.lastObject()

        NSArray primaryKeyAttributes = entity.primaryKeyAttributes();
        if (primaryKeyAttributes.count() > 1) {
            throw new RuntimeException("ERXFetchSpecificationBatchIterator: Currently only single primary key entities are supported.");
        }

        primaryKeyAttributeName = ((EOAttribute)primaryKeyAttributes.lastObject()).name();
        this.fetchSpecification = (EOFetchSpecification) fetchSpecification.clone();
        primaryKeys = pkeys;
        setEditingContext(ec != null ? ec : ERXEC.newEditingContext());
        setBatchSize(batchSize);
        setFiltersBatches(false);
View Full Code Here

Examples of com.webobjects.foundation.NSArray.lastObject()

    if (pathArray != null) {
      count = pathArray.count();
    }
    if ((pathArray != null) && (count != 0))
    {
      lastObject = (String)pathArray.lastObject();
      if (count > 1) {
        penultElement = (String)pathArray.objectAtIndex(count - 2);
      }

      length = lastObject.length();
View Full Code Here

Examples of com.webobjects.foundation.NSArray.lastObject()

     */
    public static EOEnterpriseObject enterpriseObjectForEntityNamedFromFormValues(EOEditingContext ec, String entityName, NSDictionary formValues) {
        NSArray entityGroup = enterpriseObjectsForEntityNamedFromFormValues(ec, entityName, formValues);
        if (entityGroup.count() > 1)
            log.warn("Multiple objects for entity name: " + entityName + " expecting one. objects: " + entityGroup);
        return entityGroup.count() > 0 ? (EOEnterpriseObject)entityGroup.lastObject() : null;
    }
   
    /**
     * Returns the enterprise objects fetched with decoded <code>formValues</code> from
     * <code>entityName</code>.
 
View Full Code Here

Examples of com.webobjects.foundation.NSArray.lastObject()

                Object value = qualifier.value();
                if(!(value instanceof NSArray)) {
                    value = new NSArray(value);
                }
                NSArray objects = ((NSArray)value);
                if(objects.lastObject() instanceof EOEnterpriseObject) {
                  objects = ERXEOAccessUtilities.primaryKeysForObjects(objects);
                    value = objects;
                }
            }
            EOQualifierSQLGeneration.Support support = EOQualifierSQLGeneration.Support.supportForClass(ERXInQualifier.class);
View Full Code Here

Examples of com.webobjects.foundation.NSArray.lastObject()

    public NSArray selections() {
      if (_selections == null) {
        NSArray oldValues = (NSArray) NSKeyValueCodingAdditions.Utility.valueForKeyPath(sourceObject(), relationshipKey());
        if(oldValues != null) {
          if(oldValues.lastObject() instanceof EOEnterpriseObject) {
            oldValues = ERXEOControlUtilities.localInstancesOfObjects(editingContext(), oldValues);
          }
        }
        setSelections(oldValues);
        // deal with isMandatory
View Full Code Here

Examples of com.webobjects.foundation.NSArray.lastObject()

      if (leftAlias.equals("t0")) {
        leftEntity = entity();
      }
      else {
        k = aliasesByRelationshipPath().allKeysForObject(leftAlias);
        relationshipKey = k.count() > 0 ? (String) k.lastObject() : "";
        leftEntity = entityForKeyPath(relationshipKey);
      }

      if (rightAlias.equals("t0")) {
        rightEntity = entity();
View Full Code Here

Examples of com.webobjects.foundation.NSArray.lastObject()

      if (rightAlias.equals("t0")) {
        rightEntity = entity();
      }
      else {
        k = aliasesByRelationshipPath().allKeysForObject(rightAlias);
        relationshipKey = k.count() > 0 ? (String) k.lastObject() : "";
        rightEntity = entityForKeyPath(relationshipKey);
      }

      int dotIndex = relationshipKey.indexOf(".");
      relationshipKey = dotIndex == -1 ? relationshipKey : relationshipKey.substring(relationshipKey.lastIndexOf(".") + 1);
View Full Code Here

Examples of com.webobjects.foundation.NSArray.lastObject()

     * @param entityGroups array of arrays like this: ( (entity1), (entity2), (entity3)... )
     * @return EOModelGroup containing the models that contain the entities in entityGroups
     */
    public static EOModelGroup modelGroupForEntityGroups(NSArray entityGroups) {
        NSArray anEntityGroup = (NSArray) entityGroups.lastObject();
        EOEntity anEntity = (EOEntity) anEntityGroup.lastObject();
        return anEntity.model().modelGroup();
    }


    /**
 
View Full Code Here

Examples of com.webobjects.foundation.NSArray.lastObject()

        if ( name instanceof DynamicSubscript ) {
            int len = array.count();
            switch (((DynamicSubscript)name).getFlag()) {
                case DynamicSubscript.FIRST:    return len > 0 ? array.objectAtIndex(0) : null;
                case DynamicSubscript.MID:      return len > 0 ? array.objectAtIndex(len/2) : null;
                case DynamicSubscript.LAST:     return len > 0 ? array.lastObject() : null;
                case DynamicSubscript.ALL:  return array.clone();
            }
        }
        throw new NoSuchPropertyException(target, name);
    }
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.