Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOQualifier


   *            the current options
   * @return the filtered objects
   */
  public NSArray<T> objects(NSArray<T> objects, EOEditingContext editingContext, NSKeyValueCoding options) {
    NSArray<EOSortOrdering> sortOrderings = sortOrderings(editingContext, options);
    EOQualifier qualifier = qualifier(editingContext, options);
    int batchSize = batchSize(options);

    NSArray<T> results = ERXS.sorted(ERXQ.filtered(objects, qualifier), sortOrderings);
    if (batchSize > 0) {
      int batchNumber = batchNumber(options);
View Full Code Here


               
                Rule r = (Rule)rules.objectAtIndex(c);
                if (r != null && r.lhs() != null) {
                    EOQualifierEvaluation q = r.lhs();
                    try {
                        EOQualifier cache = qualifierInCache((EOQualifier)q);
                        if (cache != null && cache != q) {
                            r.setLhs(cache);
                            //r.setLhs((EOQualifierEvaluation)cache);
                            replacedQualifiers++;
                            //uniquedQualifiers++;
View Full Code Here

    }
    return result;
  }

    protected EOQualifier qualifierContainedInEnumeration(EOQualifierEvaluation q1, Enumeration e) {
        EOQualifier containedQualifier = null;
        while (e.hasMoreElements()) {
            EOQualifierEvaluation q2 = (EOQualifierEvaluation)e.nextElement();
            if (q1.equals(q2)) {
                containedQualifier = (EOQualifier)q2; break;
            }
View Full Code Here

            uniquedQualifiers++;
        return containedQualifier;
    }

    protected EOQualifier qualifierInCache(EOQualifier q) {
        EOQualifier cacheQualifier = null;
        totalQualifiers++;
        if (q != null) {
            if (q instanceof EOKeyValueQualifier) {
                cacheQualifier = keyValueQualifierInCache((EOKeyValueQualifier)q);
            } else if (q instanceof EONotQualifier) {
View Full Code Here

    protected EOAndQualifier andQualifierInCache(EOAndQualifier q) {
        EOAndQualifier cachedQualifier = null;
        String hashEntryName = nameForSet(q.allQualifierKeys());
        Vector v = (Vector)_uniqueAndQualifiers.get(hashEntryName);
        if (v != null) {
            EOQualifier cache = qualifierContainedInEnumeration(q, v.elements());
            if (cache != null)
                cachedQualifier = (EOAndQualifier)cache;
        } else {
            v = new Vector();
            _uniqueAndQualifiers.put(hashEntryName, v);
        }
        if (cachedQualifier == null) {
            NSMutableArray qualifiers = null;
            for (int c = 0; c < q.qualifiers().count(); c++) {
                EOQualifier q1 = q.qualifiers().objectAtIndex(c);
                EOQualifier cache = qualifierInCache(q1);
                if (cache != null) {
                    if (qualifiers == null) {
                        qualifiers = new NSMutableArray();
                        qualifiers.addObjectsFromArray(q.qualifiers());
                    }
View Full Code Here

    protected EOOrQualifier orQualifierInCache(EOOrQualifier q) {
        EOOrQualifier cachedQualifier = null;
        String hashEntryName = nameForSet(q.allQualifierKeys());
        Vector v = (Vector)_uniqueOrQualifiers.get(hashEntryName);
        if (v != null) {
            EOQualifier cache = qualifierContainedInEnumeration(q, v.elements());
            if (cache != null)
                cachedQualifier = (EOOrQualifier)cache;
        } else {
            v = new Vector();
            _uniqueOrQualifiers.put(hashEntryName, v);
        }
        if (cachedQualifier == null) {
            NSMutableArray qualifiers = null;
            for (int c = 0; c < q.qualifiers().count(); c++) {
                EOQualifier q1 = q.qualifiers().objectAtIndex(c);
                EOQualifier cache = qualifierInCache(q1);
                if (cache != null) {
                    if (qualifiers == null) {
                        qualifiers = new NSMutableArray();
                        qualifiers.addObjectsFromArray(q.qualifiers());
                    }
View Full Code Here

    protected EONotQualifier notQualifierInCache(EONotQualifier q) {
        EONotQualifier cachedQualifier = null;
        String hashEntryName = nameForSet(q.allQualifierKeys());
        Vector v = (Vector)_uniqueNotQualifiers.get(hashEntryName);
        if (v != null) {
            EOQualifier cache = qualifierContainedInEnumeration(q, v.elements());
            if (cache != null)
                cachedQualifier = (EONotQualifier)cache;
        } else {
            v = new Vector();
            _uniqueNotQualifiers.put(hashEntryName, v);
        }
        if (cachedQualifier == null) {
            EOQualifier cache = qualifierInCache(q.qualifier());
            if (cache != null) {
                if (cache == q.qualifier()) {
                    log.warn("Found sub-qualifier in cache: " + cache + " when qualifier not in cache?!?! " + q);
                    v.addElement(q);
                } else {
View Full Code Here

    protected Hashtable _uniqueKeyValueQualifiers = new Hashtable();
    protected EOKeyValueQualifier keyValueQualifierInCache(EOKeyValueQualifier q) {
        EOKeyValueQualifier cachedQualifier = null;
        Vector v = (Vector)_uniqueKeyValueQualifiers.get(q.key());
        if (v != null) {
            EOQualifier cache = qualifierContainedInEnumeration(q, v.elements());
            if (cache != null) {
                cachedQualifier = (EOKeyValueQualifier)cache;
            }
        } else {
            v = new Vector();
View Full Code Here

        return ERXValueUtilities.arrayValue(d2wContext().valueForKey("prefetchingRelationshipKeyPaths"));
    }

    // add the ability to AND the existing qualifier from the DG
    public EOQualifier qualifier() {
        EOQualifier q = displayGroup.qualifier();
        EOQualifier q2 = displayGroup.qualifierFromQueryValues();
        return q == null ? q2 : (q2 == null ? q : new EOAndQualifier(new NSArray(new Object[] { q, q2 })));
    }
View Full Code Here

        if (someAttributes == null)
            throw new IllegalArgumentException("FSAdaptorChannel.selectAttributes: null attributes.");

        setAttributesToFetch(someAttributes);

        EOQualifier qualifier = null;
        String entityName = anEntity.name();

        if (aFetchSpecification != null)
            qualifier = aFetchSpecification.qualifier();
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOQualifier

Copyright © 2018 www.massapicom. 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.