Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOKeyGlobalID


        EOEditingContext ec = new EOEditingContext();
        ec.lock();
       
        Enumeration e = objects.objectEnumerator();
        while (e.hasMoreElements()) {
            EOKeyGlobalID globalID = (EOKeyGlobalID) e.nextElement();
            String entityName = globalID.entityName();

            if (shouldSynchronizeEntity(entityName)) {
                EODatabaseContext dbContext = ERCNNotificationCoordinator.databaseContextForEntityNamed(entityName, ec);
                NSMutableArray snapshotsForEntity = (NSMutableArray)result.objectForKey(entityName);
                if (snapshotsForEntity == null) {
View Full Code Here


   
        NSMutableDictionary result = new NSMutableDictionary();
       
        Enumeration e = objects.objectEnumerator();
        while (e.hasMoreElements()) {
            EOKeyGlobalID globalID = (EOKeyGlobalID) e.nextElement();
            String entityName = globalID.entityName();

            if (shouldSynchronizeEntity(entityName)) {
                NSMutableArray globalIDsForEntity = (NSMutableArray)result.objectForKey(entityName);
                if (globalIDsForEntity == null) {
                    globalIDsForEntity = new NSMutableArray();
View Full Code Here

      for (Enumeration oscs = _synchronizer.coordinators(); oscs.hasMoreElements();) {
        EOObjectStoreCoordinator osc = (EOObjectStoreCoordinator) oscs.nextElement();
        Enumeration cacheChangeEnum = remoteChange.remoteCacheChanges().objectEnumerator();
        while (cacheChangeEnum.hasMoreElements()) {
          ERXDatabase.CacheChange cacheChange = (ERXDatabase.CacheChange) cacheChangeEnum.nextElement();
          EOKeyGlobalID gid = (EOKeyGlobalID) cacheChange.gid();
          EODatabaseContext dbc = ERXEOAccessUtilities.databaseContextForEntityNamed(osc, gid.entityName());
          EODatabase database = dbc.database();
          dbc.lock();
          try {
            if (cacheChange instanceof ERXDatabase.SnapshotInserted) {
              _insertCacheChangeProcessor.processCacheChange(dbc, database, cacheChange);
View Full Code Here

     * @param entityName name of the entity
     * @param primaryKey primary key of object to be found
     * @return the shared object registered in the default shared editing context
     */
    public static EOEnterpriseObject sharedObjectWithPrimaryKey(String entityName, Object primaryKey) {
        EOKeyGlobalID gid = EOKeyGlobalID.globalIDWithEntityName(entityName, new Object[] {primaryKey});
        EOSharedEditingContext sharedEditingContext = EOSharedEditingContext.defaultSharedEditingContext();
        EOEnterpriseObject eo = sharedEditingContext.objectForGlobalID(gid);
        return (eo != null) ? eo : EOUtilities.objectWithPrimaryKeyValue(sharedEditingContext,
                                                     entityName,
                                                     primaryKey);
View Full Code Here

        EOGlobalID gid = ec.globalIDForObject(obj);
        if (gid.isTemporary()) {
            //no pk yet assigned
            return null;
        }
        EOKeyGlobalID kGid = (EOKeyGlobalID) gid;
        return kGid.keyValuesArray();
    }
View Full Code Here

    NSMutableDictionary<String, Integer> counts = new NSMutableDictionary<String, Integer>();
    ERXEC erxec = (ERXEC) ec;
    NSArray<EOGlobalID> gids = (NSArray<EOGlobalID>)ERXKeyValueCodingUtilities.privateValueForKey(erxec, "_globalIDsForRegisteredObjects");
    for(EOGlobalID gid : gids) {
      if (gid instanceof EOKeyGlobalID) {
        EOKeyGlobalID kgid = (EOKeyGlobalID) gid;
        String entityName = kgid.entityName();
        Integer count = counts.objectForKey(entityName);
        if(count == null) {
          count = Integer.valueOf(0);
          counts.setObjectForKey(count, entityName);
        }
View Full Code Here

             Enumeration gidEnum = database.snapshots().keyEnumerator();
             while (gidEnum.hasMoreElements()) {
               EOGlobalID gid = (EOGlobalID) gidEnum.nextElement();
               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);
View Full Code Here

            setGid(keyGID);
        }
    }

    public EOEnterpriseObject object() {
        EOKeyGlobalID gid = gid().globalID();
        return editingContext().faultForGlobalID(gid, editingContext());
    }
View Full Code Here

    public static final ERCAuditTrailClazz clazz = new ERCAuditTrailClazz();

    public static class ERCAuditTrailClazz extends _ERCAuditTrail._ERCAuditTrailClazz {

        public ERCAuditTrail auditTrailForObject(EOEditingContext ec, EOEnterpriseObject eo) {
            EOKeyGlobalID gid = null;
            if (eo instanceof ERXGenericRecord) {
                gid = ((ERXGenericRecord) eo).permanentGlobalID();
            } else {
                throw new IllegalArgumentException("Can't handle non ERXGenericRecord");
            }
View Full Code Here

    public EOEnterpriseObject user() {
        if (userGlobalID() == null) {
            return null;
        }
        EOKeyGlobalID gid = userGlobalID().globalID();
        EOEnterpriseObject eo = editingContext().faultForGlobalID(gid, editingContext());
        try {
            eo.willRead();
            return eo;
        } catch (EOObjectNotAvailableException e) {
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOKeyGlobalID

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.