Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOQualifier


 
  /**
   * @return count of prime numbers found by this task
   */
  public Integer countFactorialPrimes() {
    EOQualifier qFactorialPrime = ResultItem.XKEY_IS_FACTORIAL_PRIME.eq(Boolean.TRUE);
    EOQualifier qTaskInfo = ResultItem.XKEY_TASK_INFO.eq(this);
   
    return ERXEOControlUtilities.objectCountWithQualifier(editingContext(), ResultItem.ENTITY_NAME, ERXQ.and(qFactorialPrime, qTaskInfo));
  }
View Full Code Here


        EODatabaseDataSource ds = new EODatabaseDataSource(ec, entityName);
        NSArray searchKeys = (NSArray) valueForBinding("searchKeys");
        if(searchKeys == null) {
            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);
View Full Code Here

      } else {
        itemPageRange = new NSRange(startIndex, listItemIDCount);
      }

      NSArray itemPageArray = list.subarrayWithRange(itemPageRange);
      EOQualifier itemIDQualifier = new EOKeyValueQualifier(listItemIDKeyPath, EOQualifier.QualifierOperatorEqual, itemID);
      NSArray matchingItems = EOQualifier.filteredArrayWithQualifier(itemPageArray, itemIDQualifier);

      if(matchingItems.count() == 0) {
        throw new NoSuchElementException("There was no item that matched the ID '" + itemID + "' in " + list + ".");
      } else if(matchingItems.count() > 1) {
View Full Code Here

        Class c = ERXPatcher.classForName(className);
        if(c != null) {
          // we should use the class description, but it's too early for that when we
          // do this as a result of a static variable init.
          NSArray entities = (NSArray) EOModelGroup.defaultGroup().models().valueForKeyPath("entities.@flatten");
          EOQualifier q = new EOKeyValueQualifier("className", EOQualifier.QualifierOperatorEqual, className);
          NSArray candidates = EOQualifier.filteredArrayWithQualifier(entities, q);
          if(candidates.count() > 1) {
            log.warn("More than one entity found: " + candidates);
          }
          EOEntity entity = (EOEntity) candidates.lastObject();
View Full Code Here

     * @param array
     * @param spec
     * @param bindings
     */
    public NSArray<T> filteredArray(NSArray<T> array, EOFetchSpecification spec, NSDictionary bindings) {
      EOQualifier qualifier;

        if (bindings != null) {
            spec = spec.fetchSpecificationWithQualifierBindings(bindings);
        }

View Full Code Here

         * EOAdaptorContext aContext = anAdaptor.createAdaptorContext();
         * EOAdaptorChannel aChannel = aContext.createAdaptorChannel(); EOModel
         * aModel = aChannel.describeModelWithTableNames(null);
         */
        // EOModelGroup.defaultGroup().addModel(aModel);
        EOQualifier aPathQualifier = new EOKeyValueQualifier("parent", EOQualifier.QualifierOperatorEqual, args.length > 0 ? args[0] : System.getProperty("user.home"));
        EOQualifier aNameQualifier = new EOKeyValueQualifier("name", (EOQualifier.QualifierOperatorCaseInsensitiveLike), "*M*");
        EOQualifier aNotQualifier = new EONotQualifier(aNameQualifier);
        EOQualifier aQualifier = new EOAndQualifier(new NSArray(new Object[] { aPathQualifier, aNotQualifier }));
        EOFetchSpecification aFetchSpecification = new EOFetchSpecification("FSDirectory", aQualifier, null);
        EOEditingContext anEditingContext = new EOEditingContext();
        NSArray someObjects = anEditingContext.objectsWithFetchSpecification(aFetchSpecification);

        System.out.println("Fetch result for '" + aQualifier + "': " + someObjects.valueForKey("name"));
View Full Code Here

                if (aSet != null) {
                    NSArray<EOQualifier> someQualifiers = ((EOOrQualifier) aQualifier).qualifiers();
                    if (someQualifiers != null) {
                        int count = someQualifiers.count();
                        for (int index = 0; index < count; index++) {
                            EOQualifier anotherQualifier = someQualifiers.objectAtIndex(index);
                            FSQualifierHandler.addFilesWithQualifierToSet(anotherQualifier, aSet);
                        }
                    }
                    return;
                }
View Full Code Here

                if (aSet != null) {
                    NSArray<EOQualifier> someQualifiers = ((EOAndQualifier) aQualifier).qualifiers();
                    if (someQualifiers != null) {
                        int count = someQualifiers.count();
                        for (int index = 0; index < count; index++) {
                            EOQualifier anotherQualifier = someQualifiers.objectAtIndex(index);
                            FSQualifierHandler.addFilesWithQualifierToSet(anotherQualifier, aSet);
                        }
                    }
                    return;
                }
View Full Code Here

   * @param options
   *            the current options
   * @return the effective qualifier
   */
  public EOQualifier qualifier(EOEditingContext editingContext, NSKeyValueCoding options) {
    EOQualifier qualifier;
    if (!_requestQualifiersEnabled) {
      qualifier = _defaultQualifier;
    }
    else {
      String qualifierStr = (String) options.valueForKey("qualifier");
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  public Results<T> results(EOEditingContext editingContext, NSKeyValueCoding options) {
    Results<T> results;
    NSArray<EOSortOrdering> sortOrderings = sortOrderings(editingContext, options);
    EOQualifier qualifier = qualifier(editingContext, options);

    EOFetchSpecification fetchSpec = new EOFetchSpecification(_entityName, qualifier, sortOrderings);
    fetchSpec.setIsDeep(true);

    NSArray<T> objects;
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.