Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.Entity.removeProperty()


          String key = iterator.next();
          keyList.add(key);
        }
      }
      int index = RandomUtils.nextInt(keyList.size());
      entity.removeProperty((String) keyList.get(index));

      list.add(entity);

    }
    DatastoreService service = DatastoreServiceFactory.getDatastoreService();
View Full Code Here


          String key = iterator.next();
          keyList.add(key);
        }
      }
      int index = RandomUtils.nextInt(keyList.size());
      entity.removeProperty((String) keyList.get(index));

      list.add(entity);

    }
    return list;
View Full Code Here

        ObjectProvider elementOP = ec.findObjectProvider(element);
        if (elementOP != null && !ec.getApiAdapter().isDeleted(element)) {
          Entity elementEntity = getOwnerEntity(elementOP);
          if (!storeMgr.storageVersionAtLeast(StorageVersion.READ_OWNED_CHILD_KEYS_FROM_PARENTS)) {
            // Remove the external index property from the element
            elementEntity.removeProperty(getIndexPropertyName());
          }
          EntityUtils.putEntityIntoDatastore(ec, elementEntity);
        }
      } else {
        // Delete the element
View Full Code Here

    public void write(DataOutputStream st) throws IOException {
      st.writeInt(REMOVE);
      Entity e = (Entity) obj;
      Entity e1 = e.clone();
      for (String s : new HashSet<String>(e1.getProperties().keySet())) {
        e1.removeProperty(s);
      }
      EntityAccess.writeEntityToStream(e1, st);
    }

    public Object parseResult(DataInputStream communicate, Callback cb,
View Full Code Here

        Long property = (Long) entity.getProperty(s);
        if (property != null) {
          long delta = (System.currentTimeMillis() - property
              .longValue()) / 1000;
          if (delta >= 7200) {
            entity.removeProperty(s);
            hasChanges = true;
          }
        }
      }
      for (String s : new HashSet<String>(properties.keySet())) {
View Full Code Here

        }
      }
      for (String s : new HashSet<String>(properties.keySet())) {
        if (s.startsWith(corePart)) {
          if (!s.equals(key)) {
            entity.removeProperty(s);
            hasChanges = true;
          }
        }
      }
      if (hasChanges) {
View Full Code Here

        Object parentKeyObj = entity.getProperty(PARENT_KEY_PROPERTY);
        if (parentKeyObj != null) {
          AbstractClassMetaData parentCmd = sm.getMetaDataManager().getMetaDataForClass(
              ammd.getType(), fieldManager.getClassLoaderResolver());
          Key parentKey = EntityUtils.getPkAsKey(parentKeyObj, parentCmd, fieldManager.getObjectManager());
          entity.removeProperty(PARENT_KEY_PROPERTY);
          fieldManager.recreateEntityWithParent(parentKey);
        }
      }
    };
View Full Code Here

    OEntityKey entityKey = entity.getEntityKey();
    Entity e = findEntity(entitySetName, entityKey);

    // clear existing props
    for (String name : e.getProperties().keySet())
      e.removeProperty(name);

    applyProperties(e, entity.getProperties());
    applyLinks(e, entity.getLinks());
    datastore.put(e);
  }
View Full Code Here

        Object parentKeyObj = entity.getProperty(PARENT_KEY_PROPERTY);
        if (parentKeyObj != null) {
          AbstractClassMetaData parentCmd = sm.getMetaDataManager().getMetaDataForClass(
              ammd.getType(), fieldManager.getClassLoaderResolver());
          Key parentKey = EntityUtils.getPkAsKey(parentKeyObj, parentCmd, fieldManager.getObjectManager());
          entity.removeProperty(PARENT_KEY_PROPERTY);
          fieldManager.recreateEntityWithParent(parentKey);
        }
      }
    };
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.