Examples of storedValueForKey()


Examples of com.webobjects.eocontrol.EOEnterpriseObject.storedValueForKey()

         NSMutableArray objectsWithUnfaultedRelationships = new NSMutableArray();
         String relationshipName = relationship.name();
         Enumeration objectsEnum = objects.objectEnumerator();
         while (objectsEnum.hasMoreElements()) {
           EOEnterpriseObject object = (EOEnterpriseObject) objectsEnum.nextElement();
           Object relationshipValue = object.storedValueForKey(relationshipName);
           if (EOFaultHandler.isFault(relationshipValue)) {
             objectsWithUnfaultedRelationships.addObject(object);
           }
         }
         objectsToBatchFetch = objectsWithUnfaultedRelationships;
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject.storedValueForKey()

               // the regular fault resolves and there is a strong reference to the EO.  This is what EOFetchSpecification
               // pre-fetching does for to-one relationships.
               // References:
               // http://developer.apple.com/documentation/developertools/reference/wo541reference/com/webobjects/eocontrol/EODeferredFaulting.html
               // http://developer.apple.com/DOCUMENTATION/WebObjects/Enterprise_Objects/Fetching/chapter_6_section_8.html
                object.storedValueForKey(relationshipName);
             }
          }
        }
      }
      objectsToBatchFetch = objectsWithUnfaultedRelationships;
View Full Code Here

Examples of er.erxtest.model.Company.storedValueForKey()

      Company c = (Company) ec.faultForGlobalID(cGid, ec);
      // Add a new item to employees relationship
      @SuppressWarnings("unused")
      Employee e4 = c.createEmployeesRelationship();
      // I expect relationship to NOT be a fault
      Object relationshipValue = c.storedValueForKey(Company.EMPLOYEES_KEY);
      assertFalse(EOFaultHandler.isFault(relationshipValue));
      Integer count = ERXEOControlUtilities.objectCountForToManyRelationship(c, Company.EMPLOYEES_KEY);
      assertEquals(4, count.intValue());
    } finally {
      ec.unlock();
View Full Code Here

Examples of er.erxtest.model.Company.storedValueForKey()

    cGid = ERXTestUtilities.createCompanyAndNoEmployees();
    ec.lock();
    try {
      Company c = (Company) ec.faultForGlobalID(cGid, ec);
      // Fire the fault
      Object relationshipValue = c.storedValueForKey(Company.EMPLOYEES_KEY);
      assertTrue(EOFaultHandler.isFault(relationshipValue));
      EOFaulting fault = (EOFaulting) relationshipValue;
      // Fire the fault
      fault.faultHandler().completeInitializationOfObject(fault);
     
View Full Code Here

Examples of er.erxtest.model.Company.storedValueForKey()

      // Fetch Company with cGid
      c = (Company) ec1.faultForGlobalID(cGid, ec1);
      // c will be a fault
      assertTrue(EOFaultHandler.isFault(c));
     
      relationshipValue = c.storedValueForKey(Company.EMPLOYEES_KEY);
     
      // c will no longer be a fault
      assertFalse(EOFaultHandler.isFault(c));
     
      // relationshipValue will be a fault
View Full Code Here

Examples of er.erxtest.model.Company.storedValueForKey()

      ERXTestUtilities.fireFault(relationshipValue);

      // -----------------------------------------
      // Fetch Company with cGid0
      c = (Company) ec1.faultForGlobalID(cGid0, ec1);
      relationshipValue = c.storedValueForKey(Company.EMPLOYEES_KEY);
      assertTrue(EOFaultHandler.isFault(relationshipValue));
      // Fire the fault to fetch and to ensure snapshot is registered in eodb
      ERXTestUtilities.fireFault(relationshipValue);

    } finally {
View Full Code Here

Examples of er.erxtest.model.Company.storedValueForKey()

    ec2.lock();
    try {
      // Fetch Company with cGid
      c = (Company) ec2.faultForGlobalID(cGid, ec2);
      // Expect relationship to be a fault
      relationshipValue = c.storedValueForKey(Company.EMPLOYEES_KEY);
      assertTrue(EOFaultHandler.isFault(relationshipValue));
     
      // There will be a snapshot in the db
      NSArray toManySnapshot = ERXTestUtilities.snapshotArrayForRelationshipInObject(c, Company.EMPLOYEES_KEY);
      assertNotNull(toManySnapshot);
View Full Code Here

Examples of er.erxtest.model.Company.storedValueForKey()

     
      // -----------------------------------------
      // Fetch Company with cGid0
      c = (Company) ec2.faultForGlobalID(cGid0, ec2);
      // Expect relationship to be a fault
      relationshipValue = c.storedValueForKey(Company.EMPLOYEES_KEY);
      assertTrue(EOFaultHandler.isFault(relationshipValue));

      // There will be a snapshot in the db
      toManySnapshot = ERXTestUtilities.snapshotArrayForRelationshipInObject(c, Company.EMPLOYEES_KEY);
      assertNotNull(toManySnapshot);
View Full Code Here

Examples of er.erxtest.model.Company.storedValueForKey()

    EOEditingContext ec1 = ERXEC.newEditingContext(osc);
    ec1.lock();
    try {
      Company c = (Company) ec1.faultForGlobalID(cGid, ec1);
      // We expect relationship to be a fault
      Object relationshipValue = c.storedValueForKey(Company.EMPLOYEES_KEY);
      assertTrue(EOFaultHandler.isFault(relationshipValue));
     
      // There will be no snapshot in the db
      NSArray toManySnapshot = ERXTestUtilities.snapshotArrayForRelationshipInObject(c, Company.EMPLOYEES_KEY);
      assertNull(toManySnapshot);
View Full Code Here

Examples of er.erxtest.model.Employee.storedValueForKey()

      // Test failure where key is to-one fault
      ec.revert();
      ec.invalidateAllObjects();

      e = (Employee) ec.faultForGlobalID(eGid, ec);
      assertTrue(EOFaultHandler.isFault(e.storedValueForKey(Employee.COMPANY_KEY)));
      try {
        // Company is a to-one fault
        count = ERXEOControlUtilities.objectCountForToManyRelationship(e, Employee.COMPANY_KEY);
      } catch (IllegalArgumentException exception) {
        assertEquals(
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.