Examples of objectsWithFetchSpecification()


Examples of com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification()

      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));
      NSArray<EOEnterpriseObject> result = ec.objectsWithFetchSpecification(fs);
      log.info(result.count() + ": " + result.valueForKey("userCount"));
      for (EOEnterpriseObject eo : result) {
        log.info(result.count() + ": " + eo);
      }
    } finally {
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification()

                                    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);
                            for (EOEnterpriseObject target : eos) {
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification()

        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"));

        if (someObjects != null) {
            EOEnterpriseObject anObject = (EOEnterpriseObject) someObjects.lastObject();
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification()

    EOEditingContext ec = ERXEC.newEditingContext();
    ec.lock();
    try {
     
      @SuppressWarnings("unchecked")
      NSArray<EOEnterpriseObject> objects = ec.objectsWithFetchSpecification(fetchSpecification);
     
      jrDataSource = new ERJRFoundationDataSource(objects);
     
      if (jasperCompiledReportFileName != null) {
        reportFile = ERJRUtilities.runCompiledReportToPDFFile(jasperCompiledReportFileName, frameworkName, parameters, jrDataSource);
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification()

                     // database.snapshotForGlobalID(gid).mutableClone();
                     ERXDictionaryUtilities.removeMatchingEntries(memorySnapshotClone, databaseSnapshotClone);
                     if (databaseSnapshotClone.count() > 0 || memorySnapshotClone.count() > 0) {
                       mismatches.addObject(gid + " doesn't match the database: original = " + memorySnapshotClone + "; database = " + databaseSnapshotClone);
                     }
                     eo = (EOEnterpriseObject) editingContext.objectsWithFetchSpecification(gidFetchSpec).objectAtIndex(0);
                   }
                 }

                 if (eo != null) {
                   Enumeration relationshipsEnum = entity.relationships().objectEnumerator();
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification()

            if (fetchSpecification.prefetchingRelationshipKeyPaths() != null) {
              batchFS.setPrefetchingRelationshipKeyPaths(fetchSpecification.prefetchingRelationshipKeyPaths());
            }
            batchFS.setRefreshesRefetchedObjects(fetchSpecification.refreshesRefetchedObjects());
            batchFS.setRawRowKeyPaths(fetchSpecification.rawRowKeyPaths());
            nextBatch = ec.objectsWithFetchSpecification(batchFS);

            if (log.isDebugEnabled()) {
                log.debug("Actually fetched: " + nextBatch.count() + " with fetch specification: " + batchFS);
                if (primaryKeysToFetch.count() > nextBatch.count()) {
                    NSArray missedKeys = ERXArrayUtilities.arrayMinusArray(primaryKeysToFetch, (NSArray)nextBatch.valueForKey(primaryKeyAttributeName));
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification()

            qual = ERXQ.and(qual, restrictingFetchSpec().qualifier());
          }
          EOFetchSpecification fetchSpec = new EOFetchSpecification(destinationEntityName(), qual, orderings);
      fetchSpec.setIsDeep(true);
      EOEditingContext ec = ERXEC.newEditingContext();
      result = ec.objectsWithFetchSpecification(fetchSpec);
    } else {
      result = ERXQ.filtered(allItems(), qual);
    }
    return result;
  }
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification()

      Company.createCompany(editingContext, "Test Company " + i);
    }
    editingContext.saveChanges();
    EOFetchSpecification fetchSpec = new EOFetchSpecification("Company", null, null);
    fetchSpec.setFetchLimit(1);
    NSArray companies = editingContext.objectsWithFetchSpecification(fetchSpec);
    assertEquals(1, companies.size());
  }

  public void testFetchLimitWithSortOrder() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification()

      Company.createCompany(editingContext, "Test Company " + i);
    }
    editingContext.saveChanges();
    EOFetchSpecification fetchSpec = new EOFetchSpecification("Company", null, Company.NAME.descs());
    fetchSpec.setFetchLimit(1);
    NSArray<Company> companies = editingContext.objectsWithFetchSpecification(fetchSpec);
    assertEquals(1, companies.size());
    assertEquals("Test Company 9", companies.objectAtIndex(0).name());
  }

  public void testDelete() {
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.