Examples of faultForGlobalID()


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

        // Inflate it to a fault
        EOEditingContext ec = ERXEC.newEditingContext();
        // Let's ensure fresh ec since we are likely coming out of a background task
        ec.setFetchTimestamp(System.currentTimeMillis());
       
        _result = ec.faultForGlobalID((EOGlobalID) _result, ec);
       
      }
      _nextPage.takeValueForKey(_result, _nextPageResultKey);
    }
   
View Full Code Here

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

            // aJobDescription eo is refreshed because it can have been modified by the job.
            // The job can use a different EOF stack so this ec doesn't know that it has changed.
            // If we don't refresh it, we could get a updateValuesInRowDescribedByQualifier exception.
            // Trust me, we can get this exception easily.
            ec.setFetchTimestamp(System.currentTimeMillis());
            aJobDescription = (ERQSJobDescription) ec.faultForGlobalID(id, ec);
            ec.refreshObject((EOEnterpriseObject) aJobDescription);
           
            if (log.isDebugEnabled())
              log.debug("method: jobWasExecuted: aJobDescription: " + aJobDescription);
View Full Code Here

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

  private boolean batchFetchToManyFault(EODatabaseContext dbc, Object obj) {
    if (fetchingToMany.canEnter(dbc)) {
      try {
        EOAccessArrayFaultHandler handler = (EOAccessArrayFaultHandler) EOFaultHandler.handlerForFault(obj);
        EOEditingContext ec = handler.editingContext();
        EOEnterpriseObject source = ec.faultForGlobalID(handler.sourceGlobalID(), ec);
        if (source instanceof AutoBatchFaultingEnterpriseObject) {
          String key = handler.relationshipName();
          EOEntityClassDescription cd = (EOEntityClassDescription) source.classDescription();
          EORelationship relationship = cd.entity().relationshipNamed(key);
          if (_handler.batchSizeForRelationship(ec, relationship) > 0) {
View Full Code Here

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

      try {
        EOGlobalID sourceGID = eo.batchFaultingSourceGlobalID();
        String key = eo.batchFaultingRelationshipName();
        if(sourceGID != null && key != null) {
          EOEditingContext ec = eo.editingContext();
          AutoBatchFaultingEnterpriseObject source = (AutoBatchFaultingEnterpriseObject) ec.faultForGlobalID(sourceGID, ec);
          EOEntityClassDescription cd = (EOEntityClassDescription)source.classDescription();
          EORelationship relationship = cd.entity().relationshipNamed(key);
          if(_handler.batchSizeForRelationship(ec, relationship) > 0 && !relationship.isToMany()) {
            markStart("ToOne.Calculation", source, key);
            long timestamp = source.batchFaultingTimeStamp();
View Full Code Here

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

    EOGlobalID cGid = ERXTestUtilities.createCompanyAnd3Employees();
   
    EOEditingContext ec = ERXEC.newEditingContext();
    ec.lock();
    try {
      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);
View Full Code Here

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

    }
   
    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
View Full Code Here

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

   
    // Fetch
    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
View Full Code Here

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

      Integer count = ERXEOControlUtilities.objectCountForToManyRelationship(c, Company.EMPLOYEES_KEY);
      assertEquals(3, count.intValue());
     
      // -----------------------------------------
      // 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
View Full Code Here

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

    // Virgin OSC with no snapshots
    EOObjectStoreCoordinator osc = new EOObjectStoreCoordinator();
    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
View Full Code Here

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

      }

      // ----------------------------------------------------------
      // Test using a key that is not a toMany on an existing object

      c = (Company) ec.faultForGlobalID(cGid, ec);

      try {
        // address1 attribute is null
        count = ERXEOControlUtilities.objectCountForToManyRelationship(c, Company.ADDRESS1_KEY);
      } catch (IllegalArgumentException exception) {
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.