Examples of globalIDForRow()


Examples of com.webobjects.eoaccess.EOEntity.globalIDForRow()

            }
            values = new NSDictionary<String, Object>(primaryKeyValue, entity.primaryKeyAttributeNames().lastObject());
        }
        NSArray eos;
        if (prefetchingKeyPaths == null && !refreshRefetchedObjects) {
          EOGlobalID gid = entity.globalIDForRow(values);
          EOEnterpriseObject eo = ec.faultForGlobalID(gid, ec);
          if (throwIfMissing) {
            eo.willRead();
          }
          eos = new NSArray<EOEnterpriseObject>(eo);
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.globalIDForRow()

      NSArray primKeys = ERXEOControlUtilities.primaryKeyValuesInRange(ec, spec, start, end);
      EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, spec.entityName());
      NSMutableArray<EOGlobalID> gids = new NSMutableArray<EOGlobalID>();
      for (Object obj : primKeys) {
        NSDictionary pkDict = (NSDictionary) obj;
        EOGlobalID gid = entity.globalIDForRow(pkDict);
        gids.addObject(gid);
      }
      NSMutableArray objects = ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(ec, gids, spec.refreshesRefetchedObjects());

      if (spec.prefetchingRelationshipKeyPaths() != null && spec.prefetchingRelationshipKeyPaths().count() > 0) {
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.globalIDForRow()

            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

Examples of com.webobjects.eoaccess.EOEntity.globalIDForRow()

            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

Examples of com.webobjects.eoaccess.EOEntity.globalIDForRow()

        }
        EODatabase database = dbc.database();
        NSMutableDictionary snapshotsByGlobalID = new NSMutableDictionary();
        for (Enumeration snapshotsEnumerator = snapshots.objectEnumerator(); snapshotsEnumerator.hasMoreElements();) {
          NSDictionary snapshot = (NSDictionary) snapshotsEnumerator.nextElement();
          EOGlobalID globalID = entity.globalIDForRow(snapshot);
          snapshotsByGlobalID.setObjectForKey(snapshot, globalID);
        }
        if (snapshotsByGlobalID.count() > 0) {
          dbc.lock();
          try {
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.globalIDForRow()

        EOAdaptorOperation adaptorOp = (EOAdaptorOperation) e.userInfo().objectForKey(EOAdaptorChannel.FailedAdaptorOperationKey);
        EODatabaseOperation databaseOp = (EODatabaseOperation) e.userInfo().objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
        NSDictionary dbSnapshot = databaseOp.dbSnapshot();
        EOEntity entity = adaptorOp.entity();
        String entityName = entity.name();
        EOGlobalID gid = entity.globalIDForRow(dbSnapshot);
        EOEnterpriseObject eo = ec.faultForGlobalID(gid, ec);
        // EOUtilities.databaseContextForModelNamed(ec, eo.entityName()).forgetSnapshotForGlobalID(gid);
        ec.refaultObject(eo);
        // NOTE AK: I think we can just return the object here,
        // as the next time it is accessed the fault will get
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.globalIDForRow()

                    Object val = changedValues.objectForKey(key);
                    pk.setObjectForKey(val, key);
                }
            }
            EOEntity destEnt = relationship.destinationEntity();
            EOGlobalID gid = destEnt.globalIDForRow(pk);
            if(gid != null) {
                EOEnterpriseObject destEO = ec.faultForGlobalID(gid, ec);
                eo.takeValueForKey(destEO, relationship.name());
            } else {
                throw new NullPointerException("Gid is null: " + pk);
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.globalIDForRow()

          // object here is an unfaulted object, not an object with an unfaulted relationship
          objectsWithUnfaultedRelationships.addObject(object);
        }
        else {
          NSDictionary destinationPK = relationship._foreignKeyForSourceRow(sourceSnapshot);
          EOGlobalID destinationGID = destinationEntity.globalIDForRow(destinationPK);
          if (destinationGID != null) {
             NSDictionary destinationSnapshot = databaseContext.snapshotForGlobalID(destinationGID, editingContext.fetchTimestamp());
             if (destinationSnapshot == null || ! skipFaultedRelationships) {
                gids.addObject(destinationGID);
               
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.globalIDForRow()

        EOEntity entity = EOUtilities.entityNamed(this, anObject.entityName());
        NSArray primaryKeyAttributes = entity.primaryKeyAttributes();
        if (primaryKeyAttributes.count() != 1)
            throw new IllegalArgumentException(entity.name() + " has a compound primary key and can't be used with insertSavedObject().");
        NSDictionary primaryKeyDictionary = new NSDictionary(fakePrimaryKeyCounter++, ((EOAttribute)primaryKeyAttributes.objectAtIndex(0)).name());
        EOGlobalID globalID = entity.globalIDForRow(primaryKeyDictionary);
        anObject.__setGlobalID(globalID);
        return globalID;
    }

    /**
 
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.