Examples of globalIDForObject()


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

            assertEquals("Company", c.name());
            assertEquals(100.0, c.revenue().doubleValue());
            NSArray<Person> employees = c.employees();
            assertEquals(1, employees.count());
            Person p = employees.objectAtIndex(0);
            assertTrue(editingContext.globalIDForObject(p).isTemporary());
            assertEquals("Mike", p.name());
            assertEquals(10, p.age().intValue());
            assertEquals(null, p.salary());
        }
        finally {
View Full Code Here

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

            ERXRestFormat.json().parse("{\"name\":\"Mike Updated\",\"company\":{\"name\":\"Company Updated\"}}").updateObjectWithFilter(p, ERXKeyFilter.filterWithAllRecursive(), new ERXRestContext(editingContext));
            assertEquals("Mike Updated", p.name());
            assertNotSame(c, p.company());
            assertNotNull(p.company());
            assertFalse(editingContext.deletedObjects().containsObject(c));
            assertTrue(editingContext.globalIDForObject(p.company()).isTemporary());
            assertEquals("Company Updated", p.company().name());
        }
        finally {
            editingContext.unlock();
            editingContext.dispose();
View Full Code Here

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

    else if (eoSupport(component) && object instanceof EOEnterpriseObject) {
      EOEnterpriseObject eo = (EOEnterpriseObject)object;
      EOEditingContext editingContext = eo.editingContext();
      EOGlobalID gid = null;
      if (editingContext != null) {
        gid = editingContext.globalIDForObject(eo);
      }
      // If the EO isn't in an EC, or it has a null GID, then just fall back to the hash code
      if (gid == null) {
        hashCode = System.identityHashCode(object);
      }
View Full Code Here

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

   */
  public static NSArray snapshotArrayForRelationshipInObject(EOEnterpriseObject object, final String relationshipName) {
      final EOEditingContext ec = object.editingContext();
      EOEntity entity = EOUtilities.entityForObject(ec, object);

        final EOGlobalID gid = ec.globalIDForObject(object);
        String modelName = entity.model().name();
        final EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, modelName);

        NSArray toManySnapshot = ERXEOAccessUtilities.executeDatabaseContextOperation(dbc, 2,
                new DatabaseContextOperation<NSArray>() {
View Full Code Here

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

     */
    public static NSDictionary snapshotForObject(EOEnterpriseObject object) {
        final EOEditingContext ec = object.editingContext();
        EOEntity entity = EOUtilities.entityForObject(ec, object);

        final EOGlobalID gid = ec.globalIDForObject(object);
        String modelName = entity.model().name();
        final EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, modelName);

        NSDictionary snapshot = ERXEOAccessUtilities.executeDatabaseContextOperation(dbc, 2,
                new DatabaseContextOperation<NSDictionary>() {
View Full Code Here

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

      p.setPaymentDate(new NSTimestamp());
     
      p.setEmployeeRelationship(e1);
     
      ec.saveChanges();
      return ec.globalIDForObject(c);
    } finally {
      ec.unlock();
    }
  }
 
View Full Code Here

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

    ec.lock();
    try {
      Company c = (Company) EOUtilities.createAndInsertInstance(ec, Company.ENTITY_NAME);
      c.setName("Disney World");
      ec.saveChanges();
      return ec.globalIDForObject(c);
    } finally {
      ec.unlock();
    }
  }
View Full Code Here

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

            exception.getMessage());
      }

      e = c.employees().objectAtIndex(0);

      EOGlobalID eGid = ec.globalIDForObject(e);
      try {
        // Company is not null
        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.