Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOFetchSpecification.qualifier()


      if (relationship.isToManyToOne() && destinationEntity.isAbstractEntity() && fetchSpec.prefetchingRelationshipKeyPaths().containsObject(relationship.name())) {
        EOFetchSpecification newFetchSpec = (EOFetchSpecification) fetchSpec.clone();
        String inverseName = relationship.anyInverseRelationship().definition(); // from destination to intermediate
        EOQualifier singleTableRestrict = destinationEntity._singleTableRestrictingQualifier();
        EOQualifier migratedRestrict = EOQualifierSQLGeneration.Support._qualifierMigratedFromEntityRelationshipPath(singleTableRestrict, destinationEntity, inverseName);
        newFetchSpec.setQualifier(new EOAndQualifier(new NSArray(new Object[]{newFetchSpec.qualifier(),migratedRestrict})));
        fetchSpec = newFetchSpec;
      }
    }
    return fetchSpec;
  }
View Full Code Here


          int limit = ERXValueUtilities.intValueWithDefault(context().request().stringFormValueForKey(fetchLimitKey), 200);
          fs.setFetchLimit(limit);
        } else {
          fs = EOFetchSpecification.fetchSpecificationNamed(fsName, entityName);
          NSMutableDictionary bindings = new NSMutableDictionary();
          Enumeration e = fs.qualifier().bindingKeys().objectEnumerator();
          while(e.hasMoreElements()) {
            String key = (String)e.nextElement();
            String formValue = context().request().stringFormValueForKey(key);
            if(formValue != null) {
              bindings.setObjectForKey(formValue, key);
View Full Code Here

        unboundFetchSpec = fetchSpecificationNamed(ec, fetchSpecName);
        if (unboundFetchSpec == null) {
            return null;
        }
        boundFetchSpec = unboundFetchSpec.fetchSpecificationWithQualifierBindings(bindings);
        return objectCountWithQualifier(ec, boundFetchSpec.qualifier());
    }

    /**
     * Constructs a fetch specification that will only fetch the primary
     * keys for a given qualifier.
View Full Code Here

                                                        String fetchSpecificationName,
                                                        NSDictionary bindings) {
       EOFetchSpecification fs = fetchSpecificationNamedWithBindings(entityName,
                                                                     fetchSpecificationName,
                                                                     bindings);
        return aggregateFunctionWithQualifier(ec, entityName, attributeName, function, fs.qualifier());
    }

    /**
     * Computes an aggregate function for a given attribute
     * restricted by a given qualifier. For instance
View Full Code Here

    query.setName(fetchSpecName);

    query.setDistinct(fetchSpec.usesDistinct());
    query.setFetchingDataRows(fetchSpec.fetchesRawRows());
   
    String qualString = fetchSpec.qualifier().toString();
    qualString = qualString.replace(" caseinsensitivelike ", " likeIgnoreCase ");
    qualString = qualString.replace(" caseInsensitiveLike ", " likeIgnoreCase ");
    qualString = qualString.replace(" AND ", " and ");
    qualString = qualString.replace(" OR ", " or ");
    if (qualString.contains(" like ") || qualString.contains(" likeIgnoreCase ")) {
View Full Code Here

            spec = spec.fetchSpecificationWithQualifierBindings(bindings);
        }

        result = new NSArray<T>(array);

        if ((qualifier = spec.qualifier()) != null) {
            result = EOQualifier.filteredArrayWithQualifier(result, qualifier);
        }

        if ((sortOrderings = spec.sortOrderings()) != null) {
            result = EOSortOrdering.sortedArrayUsingKeyOrderArray(result,sortOrderings);
View Full Code Here

    EOFetchSpecification fs = new EOFetchSpecification(entity.name(), qualifier, null, false, true, null);

    if (qualifier != null) {
      qualifier = EOQualifierSQLGeneration.Support._schemaBasedQualifierWithRootEntity(qualifier, entity);
    }
    if (qualifier != fs.qualifier()) {
      fs.setQualifier(qualifier);
    }

    // ASSUME: This makes a few assumptions, if anyone can figure out a fool
    // proof way that would be nice to get the model
View Full Code Here

  protected EOFetchSpecification fetchSpecification() {
    EODatabaseDataSource ds = (EODatabaseDataSource) dataSource();
    EOFetchSpecification spec = (EOFetchSpecification) ds.fetchSpecificationForFetch().clone();
    spec.setSortOrderings(ERXArrayUtilities.arrayByAddingObjectsFromArrayWithoutDuplicates(sortOrderings(), spec.sortOrderings()));
    EOQualifier dgQualifier = qualifier();
    EOQualifier qualifier = spec.qualifier();
    if (dgQualifier != null) {
      if (qualifier != null) {
        qualifier = new ERXAndQualifier(dgQualifier, qualifier);
      } else {
        qualifier = dgQualifier;
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.