Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOOrQualifier


    if (q == null)
      result = Boolean.TRUE;
    else {
      visit(q);
      if (q instanceof EOOrQualifier) {
        EOOrQualifier aq = (EOOrQualifier) q;
        if (!postOrder) {
          result = traverseOrQualifier(aq) ? Boolean.TRUE : Boolean.FALSE;
        }
        if (result == null || result.booleanValue()) {
          for (Enumeration e = aq.qualifiers().objectEnumerator(); e.hasMoreElements();) {
            if (!traverseQualifier((EOQualifierEvaluation) e.nextElement(), postOrder)) {
              result = Boolean.FALSE;
              break;
            }
          }
        }
        if (postOrder && (result == null || result.booleanValue())) {
          result = traverseOrQualifier(aq) ? Boolean.TRUE : Boolean.FALSE;
        }
      }
      else if (q instanceof EOAndQualifier) {
        EOAndQualifier aq = (EOAndQualifier) q;
        if (!postOrder) {
          result = traverseAndQualifier(aq) ? Boolean.TRUE : Boolean.FALSE;
        }
        if (result == null || result.booleanValue()) {
          for (Enumeration e = aq.qualifiers().objectEnumerator(); e.hasMoreElements();) {
            if (!traverseQualifier((EOQualifierEvaluation) e.nextElement(), postOrder)) {
              result = Boolean.FALSE;
              break;
            }
          }
        }
        if (postOrder && (result == null || result.booleanValue())) {
          result = traverseAndQualifier(aq) ? Boolean.TRUE : Boolean.FALSE;
        }
      }
      else if (q instanceof EONotQualifier) {
        EONotQualifier aq = (EONotQualifier) q;
        if (!postOrder) {
          result = traverseNotQualifier(aq) ? Boolean.TRUE : Boolean.FALSE;
        }
        if (result == null || result.booleanValue()) {
          result = traverseQualifier((EOQualifierEvaluation) aq.qualifier(), postOrder) ? Boolean.TRUE : Boolean.FALSE;
        }
        if (postOrder && (result == null || result.booleanValue())) {
          result = traverseNotQualifier(aq) ? Boolean.TRUE : Boolean.FALSE;
        }
      }
View Full Code Here


        Boolean result=null;
        if (q==null)
            result=Boolean.TRUE;
        else {
            if (q instanceof EOOrQualifier) {
                EOOrQualifier aq=(EOOrQualifier)q;
                cb.traverseOrQualifier(aq);
                result=Boolean.TRUE;
                for (Enumeration e=aq.qualifiers().objectEnumerator(); e.hasMoreElements(); ) {
                    if (!traverseQualifier((EOQualifierEvaluation)e.nextElement(),cb)) {
                        result=Boolean.FALSE;
                        break;
                    }
                }
            } else if (q instanceof EOAndQualifier) {
                EOAndQualifier aq=(EOAndQualifier)q;
                cb.traverseAndQualifier(aq);
                result=Boolean.TRUE;
                for (Enumeration e=aq.qualifiers().objectEnumerator(); e.hasMoreElements(); ) {
                    if (!traverseQualifier((EOQualifierEvaluation)e.nextElement(),cb)) {
                        result=Boolean.FALSE;
                        break;
                    }
                }
View Full Code Here

        return cachedQualifier;
    }

    protected Hashtable _uniqueOrQualifiers = new Hashtable();
    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());
                    }
                    if (cache == q1)
                        log.warn("Found sub-qualifier: " + cache + " in cache when parent qualifier is not?!?!");
                    else
                        qualifiers.replaceObjectAtIndex(cache, c);
                }
            }
            if (qualifiers != null) {
                // Need to reconstruct
                cachedQualifier = new EOOrQualifier(qualifiers);
                v.addElement(cachedQualifier);
            } else {
                v.addElement(q);
            }
        }
View Full Code Here

            NSMutableArray qualifiers = new NSMutableArray();
            for (int i = oriQualifiers.count(); i-- > 0;) {
                EOQualifier qual = (EOQualifier)oriQualifiers.objectAtIndex(i);
                qualifiers.addObject(localInstancesInQualifier(ec, qual));
            }
            return q instanceof EOAndQualifier ? new EOAndQualifier(qualifiers) : new EOOrQualifier(qualifiers);
        } else if (q instanceof EONotQualifier) {
            EONotQualifier qNot = (EONotQualifier)q;
            EOQualifier qual = localInstancesInQualifier(ec, qNot.qualifier());
            return new EONotQualifier(qual);
        }
View Full Code Here

        if(keys.count() > 0) {
            for (Enumeration i = keys.objectEnumerator(); i.hasMoreElements();) {
                String key = (String) i.nextElement();
                qualifiers.addObject(new EOKeyValueQualifier(key, selector, value));
            }
            result = new EOOrQualifier(qualifiers);
        }
        return result;
    }
View Full Code Here

     for (Enumeration e=keyPaths.objectEnumerator(); e.hasMoreElements();) {
      String key = (String)e.nextElement();
      EOQualifier qualifier = new EOKeyValueQualifier(key, selector, value);
      qualifiers.addObject(qualifier);
     }
     return new EOOrQualifier(qualifiers);
   }
View Full Code Here

     for (Enumeration e=values.objectEnumerator(); e.hasMoreElements();) {
      Object value = e.nextElement();
      EOQualifier qualifier = orQualifierForKeyPaths(keyPaths, selector, value);
      qualifiers.addObject(qualifier);
     }
     return new EOOrQualifier(qualifiers);
   }
View Full Code Here

       return q2;
     }
     if(q2 == null) {
       return q1;
     }
     return new EOOrQualifier(new NSArray(new Object[]{q1, q2}));
    }
View Full Code Here

              EOQualifier qualifier = entity.qualifierForPrimaryKey(entity.primaryKeyForGlobalID(g));
              qualifiers.addObject(qualifier);
            }
          }
          if (qualifiers.count() > 0) {
            EOQualifier qualifier = qualifiers.count() > 1 ? new EOOrQualifier(qualifiers) : qualifiers.lastObject();
            EOFetchSpecification fetchSpec = new EOFetchSpecification(entityName, qualifier, null);
            fetchSpec.setRefreshesRefetchedObjects(refreshesRefetchedObjects);
            NSArray<EOEnterpriseObject> details = ec.objectsWithFetchSpecification(fetchSpec);
            result.addObjectsFromArray(details);
          }
View Full Code Here

  protected EOOrQualifier qualifierArrayForEmailPatterns(NSArray<String> emailPatterns) {
    NSMutableArray<EOQualifier> patternQualifiers = new NSMutableArray<EOQualifier>();
    for (String pattern : emailPatterns) {
      patternQualifiers.addObject(EOQualifier.qualifierWithQualifierFormat("toString caseInsensitiveLike '" + pattern + "'", null));
    }
    return new EOOrQualifier(patternQualifiers);
  }
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOOrQualifier

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.