Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOGlobalID


 
  @Override
  public int indexOfObject(Object object) {
    if (object instanceof EOEnterpriseObject) {
      EOEnterpriseObject eo = (EOEnterpriseObject) object;
      EOGlobalID gid = editingContext().globalIDForObject(eo);
      for (int i = 0; i < count(); i++) {
        EOGlobalID current = _array[i];
        if(current.equals(gid)) {
          return i;
        }
      }
      return NotFound;
    }
View Full Code Here


    ds.setArray(objects);
    return ds;
  }

  public static EOEnterpriseObject recordForObject(EOEditingContext ec, Object o) {
    EOGlobalID gid = new GlobalID(o);

    EOEnterpriseObject eo = ec.objectForGlobalID(gid);
    if(eo == null) {
      eo = new ERXDummyRecord(o);
      ec.recordObject(eo, gid);
View Full Code Here

                }
            } else {
                if (adaptorType == AdaptorNumberType) {
                    defaultValue = Integer.valueOf(stringValue);
                }
                EOGlobalID gid = EOKeyGlobalID.globalIDWithEntityName(relationshipEntityName, new Object[] {defaultValue});
                EOEnterpriseObject fault = ec.faultForGlobalID(gid,ec);
                eo.addObjectToBothSidesOfRelationshipWithKey(fault,key);
            }
        }
View Full Code Here

                if(entries != null) {
                    NSArray gids = (NSArray) entries.objectForKey(sourceGid);
                    if(gids != null) {
                        NSMutableArray eos = new NSMutableArray(gids.count());
                        for (Enumeration enumerator = gids.objectEnumerator(); enumerator.hasMoreElements();) {
                            EOGlobalID gid = (EOGlobalID) enumerator.nextElement();
                            EOEnterpriseObject eo = ec.faultForGlobalID(gid, ec);
                            eos.addObject(eo);
                        }
                        EOFaultHandler.clearFault(obj);
                        ((NSMutableArray)fault).addObjectsFromArray(eos);
View Full Code Here

      NSMutableDictionary result = new NSMutableDictionary();
      NSMutableDictionary dbcs = new NSMutableDictionary();

      for (Enumeration gids = objects.objectEnumerator(); gids.hasMoreElements();) {
        EOGlobalID gid = (EOGlobalID) gids.nextElement();
        if (gid instanceof EOKeyGlobalID) {
          EOKeyGlobalID globalID = (EOKeyGlobalID) gid;
          String entityName = globalID.entityName();
          String key = entityName + "/" + System.identityHashCode(osc);
          EODatabaseContext dbc = (EODatabaseContext) dbcs.objectForKey(key);
View Full Code Here

      if (editingContext != null) {
        editingContext.lock();
        try {
          pkValue = ERXEOControlUtilities.primaryKeyObjectForObject(eo);
          if (pkValue == null) {
            EOGlobalID gid = editingContext.globalIDForObject(eo);
            if (gid instanceof EOTemporaryGlobalID) {
              pkValue = new NSData(((EOTemporaryGlobalID) gid)._rawBytes());
            }
          }
        }
View Full Code Here

      throw new IllegalArgumentException("There was no editing context attached to this rest context.");
    }
    editingContext.lock();
    Object obj;
    try {
      EOGlobalID gid = ERXEOControlUtilities.globalIDForString(editingContext, entity.entityName(), strPKValue);
      return editingContext.faultForGlobalID(gid, editingContext);
    }
    finally {
      editingContext.unlock();
    }
View Full Code Here

            while (snapshotsEnumerator.hasMoreElements()) {
                NSDictionary snapshot = (NSDictionary)snapshotsEnumerator.nextElement();
                if (NSLog.debug.isEnabled())
                    NSLog.debug.appendln(ERCNNotificationCoordinator.LOG_HEADER + "Snapshot: " + snapshot);
                if (snapshot != null) {
                    EOGlobalID globalID = entity.globalIDForRow(snapshot);
                    dbContext.lock();
                    database.forgetSnapshotForGlobalID(globalID);
                    database.recordSnapshotForGlobalID(snapshot, globalID);
                    dbContext.unlock();
                }
View Full Code Here

            if (!relationship.isToMany()) {
              EORelationship inverseRelationship = relationship.inverseRelationship();
              if (inverseRelationship != null && inverseRelationship.isToMany()) {
                EOEntity destEntity = inverseRelationship.entity();
                NSDictionary destPK = relationship._foreignKeyForSourceRow(snapshot);
                EOGlobalID destGID = destEntity.globalIDForRow(destPK);
                if (destGID != null) {
                  processRelationship(database, gid, relationship, destGID, inverseRelationship, context, settings);
                }
              }
            }
View Full Code Here

      public DeleteCacheChangeProcessor() {}

      @Override
      public void processCacheChange(EODatabaseContext dbc, EODatabase database, CacheChange cacheChange) {
        ERXDatabase.SnapshotDeleted deleteChange = (ERXDatabase.SnapshotDeleted) cacheChange;
        EOGlobalID gid = deleteChange.gid();
        ERXObjectStoreCoordinatorSynchronizer.setProcessingRemoteNotifications(true);
        try {
          database.forgetSnapshotForGlobalID(gid);
        }
        finally {
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOGlobalID

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.