Examples of snapshotForGlobalID()


Examples of com.webobjects.eoaccess.EODatabase.snapshotForGlobalID()

               if (gid instanceof EOKeyGlobalID) {
                 EOEnterpriseObject eo = null;
                 EOKeyGlobalID keyGID = (EOKeyGlobalID) gid;
                 String entityName = keyGID.entityName();
                 EOEntity entity = modelGroup.entityNamed(entityName);
                 NSDictionary snapshot = database.snapshotForGlobalID(gid);
                 if (snapshot != null) {
                   EOQualifier gidQualifier = entity.qualifierForPrimaryKey(entity.primaryKeyForGlobalID(gid));
                   EOFetchSpecification gidFetchSpec = new EOFetchSpecification(entityName, gidQualifier, null);

                   NSMutableDictionary databaseSnapshotClone;
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabase.snapshotForGlobalID()

                     EORelationship relationship = (EORelationship) relationshipsEnum.nextElement();
                     String relationshipName = relationship.name();
                     NSArray originalDestinationGIDs = database.snapshotForSourceGlobalID(keyGID, relationshipName);
                     if (originalDestinationGIDs != null) {
                       NSMutableArray newDestinationGIDs = new NSMutableArray();
                       EOQualifier qualifier = relationship.qualifierWithSourceRow(database.snapshotForGlobalID(keyGID));
                       EOFetchSpecification relationshipFetchSpec = new EOFetchSpecification(entityName, qualifier, null);
                       EOAdaptorChannel channel = databaseContext.availableChannel().adaptorChannel();
                       channel.openChannel();
                       try {
                         channel.selectAttributes(relationship.destinationEntity().attributesToFetch(), relationshipFetchSpec, false, relationship.destinationEntity());
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabase.snapshotForGlobalID()

     
      if(gids != null) {
        NSMutableArray<EOEnterpriseObject> eos = new NSMutableArray<EOEnterpriseObject>(gids.count());
        EODatabase database = dbc.database();
        for (EOGlobalID gid : gids) {
          NSDictionary snapshotForGlobalID = database.snapshotForGlobalID(gid);
          if(snapshotForGlobalID == null || dbc.snapshotForGlobalID(gid, ec.fetchTimestamp()) == null) {
            // not found with recent timestamp
            return null;
          }
          database.recordSnapshotForGlobalID(snapshotForGlobalID, gid);
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabase.snapshotForGlobalID()

                entityStats = new SEEntityStats(databaseContext, entity);
                _entityStats.put(entityName, entityStats);
              }
            }
            if (entityStats != null) {
              NSDictionary<String, Object> snapshot = (NSDictionary<String, Object>) database.snapshotForGlobalID(gid);
              entityStats.addSnapshot(kgid, snapshot);
            }
          }
        }
      }
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.snapshotForGlobalID()

        String aModelName = anEntity.model().name();
        EODatabaseContext aDatabaseContext = EOUtilities
            .databaseContextForModelNamed(anEditingContext,
                aModelName);
        aDatabaseContext.lock();
        NSDictionary aRow = aDatabaseContext
            .snapshotForGlobalID(aGlobalID);
        aDatabaseContext.unlock();
        EOQualifier aQualifier = aRelationship
            .qualifierWithSourceRow(aRow);
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.snapshotForGlobalID()

          if (snapshotsForEntity == null) {
            snapshotsForEntity = new NSMutableArray();
            result.setObjectForKey(snapshotsForEntity, entityName);
          }
          synchronized (snapshotsForEntity) {
            Object o = dbc.snapshotForGlobalID(globalID);
            if (o != null) {
              snapshotsForEntity.addObject(o);
            }
          }
        }
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.snapshotForGlobalID()

                NSMutableArray snapshotsForEntity = (NSMutableArray)result.objectForKey(entityName);
                if (snapshotsForEntity == null) {
                    snapshotsForEntity = new NSMutableArray();
                    result.setObjectForKey(snapshotsForEntity, entityName);
                }
                NSDictionary snapshot = dbContext.snapshotForGlobalID(globalID);
                if (snapshot != null) {
                    snapshotsForEntity.addObject(snapshot);
                    _entryCount++;
                }
            }
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.snapshotForGlobalID()

          EOAttribute attribute = relationship.sourceAttributes().lastObject();
          EODatabaseContext context = EOUtilities.databaseContextForModelNamed(ec, entity.model().name());
          String name = attribute.name();
          for (Enumeration e = eos.objectEnumerator(); e.hasMoreElements();) {
            EOEnterpriseObject target = (EOEnterpriseObject) e.nextElement();
            Object value = (context.snapshotForGlobalID(ec.globalIDForObject(target))).valueForKey(name);
            result.addObject(value);
          }
        } else {
          throw new IllegalArgumentException("Has more than one relationship attribute: " + relKey);
        }
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.snapshotForGlobalID()

              else {
                NSDictionary row;
                    EODatabaseContext databaseContext = (EODatabaseContext) ((EOObjectStoreCoordinator) ec.rootObjectStore()).objectStoreForGlobalID(g);
                    databaseContext.lock();
                    try {
                  row = databaseContext.snapshotForGlobalID(g, ec.fetchTimestamp());
                    }
                    finally {
                      databaseContext.unlock();
                    }
                if (row == null) {
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.snapshotForGlobalID()

        NSDictionary snapshot = ERXEOAccessUtilities.executeDatabaseContextOperation(dbc, 2,
                new DatabaseContextOperation<NSDictionary>() {
                    public NSDictionary execute(EODatabaseContext databaseContext) throws Exception {
                        // Search for and return the snapshot
                        return dbc.snapshotForGlobalID(gid, ec.fetchTimestamp());
                    }
                });
        return snapshot;
    }
   
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.