Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOAndQualifier


      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


        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

      endQualifiers.addObject(new ERXKeyValueQualifier(endDateKey, EOQualifier.QualifierOperatorEqual, null));
      endQualifiers.addObject(new ERXKeyValueQualifier(endDateKey, EOQualifier.QualifierOperatorGreaterThanOrEqualTo, date));
    }
    EOQualifier endQualifier = new ERXOrQualifier(endQualifiers);

    EOAndQualifier qualifier = new ERXAndQualifier(new NSArray<EOQualifier>(new EOQualifier[] { startQualifier, endQualifier }));
    return qualifier;

    /*
    System.out.println("DateUtils.dateWithinKeypathRangeQualifier: " + startDateKey + ", " + endDateKey + ", " + date);
   
View Full Code Here

      EOQualifier q1 = new EOKeyValueQualifier("contents", EOQualifier.QualifierOperatorLike, "suspend*");
      EOQualifier q2 = new ERXBetweenQualifier("userCount", Long.valueOf(30), Long.valueOf(800));
      // EOQualifier q3 = new EOKeyValueQualifier("userCount", EOQualifier.QualifierOperatorEqual, Long.valueOf(82));
      //EOQualifier q3 = new EOKeyValueQualifier("userCount", EOQualifier.QualifierOperatorLessThan, Long.valueOf(82));
      EOQualifier q3 = new EOKeyValueQualifier("userCount", EOQualifier.QualifierOperatorLessThanOrEqualTo, Long.valueOf(802));
      EOQualifier qualifier = new EOAndQualifier(new NSArray<EOQualifier>(new EOQualifier[]{q1, q2, q3}));
      EOFetchSpecification fs = new EOFetchSpecification("LuceneAsset", qualifier, null);
      fs.setFetchLimit(5);
      fs.setSortOrderings(new NSArray(new EOSortOrdering("userCount", EOSortOrdering.CompareAscending)));
      Query query = ERLuceneAdaptorChannel.queryForQualifier(new EOKeyValueQualifier("userCount", EOQualifier.QualifierOperatorLessThanOrEqualTo, 802), EOUtilities.entityNamed(ec, "LuceneAsset"));
      fs.setHints(new NSDictionary(query, ERLuceneAdaptor.QUERY_HINTS));
View Full Code Here

              }
            }
          }
          EOQualifier qualifier = null;
          if(qualifiers.count() > 0) {
            qualifier = new EOAndQualifier(qualifiers);
          }
          fs = new EOFetchSpecification(entityName, qualifier, null);
         
          boolean usesDictinct = ERXValueUtilities.booleanValueWithDefault(context().request().stringFormValueForKey(usesDistinctKey), true);
          fs.setUsesDistinct(usesDictinct);
View Full Code Here

                        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

      }
      else {
        NSMutableArray qualifiers = new NSMutableArray();
        qualifiers.addObject(qualifier);
        qualifiers.addObject(inverseQualifier);
        fullQualifier = new EOAndQualifier(qualifiers);
      }

      results = er.ajax.mootools.example.components.Employee.fetchEmployees(editingContext(), fullQualifier, sortOrderings);
    }
    else {
View Full Code Here

      sortOrderings = fetchSpecification.sortOrderings();
    }

    if (entity.restrictingQualifier() != null) {
      if (qualifier != null) {
        qualifier = new EOAndQualifier(new NSArray(new EOQualifier[] { qualifier, entity.restrictingQualifier() }));
      } else {
        qualifier = entity.restrictingQualifier();
      }
    }
View Full Code Here

            searchKeys = ERXEOControlUtilities.stringAttributeListForEntityNamed(ec, entityName);
        }
        EOQualifier qualifier = ERXEOControlUtilities.qualifierMatchingAnyKey(searchKeys, EOQualifier.QualifierOperatorCaseInsensitiveLike, "*" + searchValue + "*");
        EOQualifier restrictingQualifier = (EOQualifier) valueForBinding("extraRestrictingQualifier");
        if(restrictingQualifier != null) {
            qualifier = new EOAndQualifier(new NSArray(new Object[]{qualifier, restrictingQualifier}));
        }
        EOFetchSpecification fs = new EOFetchSpecification(entityName, qualifier, null);
        ds.setFetchSpecification(fs);
        return ds;
    }
View Full Code Here

                                    EOJoin join = (EOJoin) iterator.next();
                                    Object pkValue = pk.objectForKey(join.sourceAttribute().name());
                                    EOKeyValueQualifier qualifier = new EOKeyValueQualifier(join.destinationAttribute().name(), EOQualifier.QualifierOperatorEqual, pkValue);
                                    qualifiers.addObject(qualifier);
                                }
                                fs.setQualifier(qualifiers.count() == 1 ? qualifiers.lastObject() : new EOAndQualifier(qualifiers));
                                value = ec.objectsWithFetchSpecification(fs);
                            }
                        }
                        if (value != null) {
                            NSArray<EOEnterpriseObject> eos = (value instanceof EOEnterpriseObject ? new NSArray(value) : (NSArray) value);
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOAndQualifier

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.