Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOFaulting


     */
    public boolean clearFault(Object obj) {
        if(!EOFaultHandler.isFault(obj)) {
            return true;
        }
        EOFaulting fault = (EOFaulting)obj;
        if (fault.faultHandler() instanceof EOAccessArrayFaultHandler) {
            EOAccessArrayFaultHandler handler = (EOAccessArrayFaultHandler) fault.faultHandler();
            EOKeyGlobalID sourceGid = handler.sourceGlobalID();
            EOEditingContext ec = handler.editingContext();
            synchronized (cache) {
                NSDictionary entries = relationshipCacheEntriesForEntity(sourceGid.entityName(), handler.relationshipName());
                if(entries != null) {
View Full Code Here


          EOGlobalID gid = ec.globalIDForObject(eo);
          database.recordSnapshotForSourceGlobalID(null, gid, relationshipName);
          Object o = eo.storedValueForKey(relationshipName);
          boolean needRefresh = false;
          if(o instanceof EOFaulting) {
            EOFaulting toManyArray = (EOFaulting)o;
              if (!toManyArray.isFault()) {
                EOFaulting tmpToManyArray = (EOFaulting)((EOObjectStoreCoordinator)ec.rootObjectStore()).arrayFaultWithSourceGlobalID(gid, relationshipName, ec);
                toManyArray.turnIntoFault(tmpToManyArray.faultHandler());
                needRefresh = true;
              }
          } else {
            EOFaulting tmpToManyArray = (EOFaulting)((EOObjectStoreCoordinator)ec.rootObjectStore()).arrayFaultWithSourceGlobalID(gid, relationshipName, ec);
            eo.takeStoredValueForKey(tmpToManyArray, relationshipName);
            needRefresh = true;
          }
          if(needRefresh && (eo instanceof ERXEnterpriseObject)) {
            ((ERXEnterpriseObject)eo).flushCaches();
View Full Code Here

   *
   * @param object
   */
  public static void fireFault(Object object) {
      if (EOFaultHandler.isFault(object)) {
            EOFaulting fault = (EOFaulting)object;
            fault.faultHandler().completeInitializationOfObject(fault);
            ERXAssert.POST.isFalse(EOFaultHandler.isFault(object));
        }
  }
View Full Code Here

    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);
     
      // Now I expect relationship to NOT be a fault
      assertFalse(EOFaultHandler.isFault(relationshipValue));
      Integer count = ERXEOControlUtilities.objectCountForToManyRelationship(c, Company.EMPLOYEES_KEY);
      assertEquals(0, count.intValue());
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOFaulting

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.