Type:Note
DatastoreService gaeDatastore = DatastoreServiceFactory.getDatastoreService(); Entity user = gaeDatastore.get(KeyFactory.stringToKey("aglzaG9wc21lbnVyEwsSBlNtVXNlchiAgICAgICoCgw")); Entity userEMail = gaeDatastore.get(KeyFactory.stringToKey("aglzaG9wc21lbnVyGAsSC1NtVXNlckVNYWlsGICAgICAgKgJDA")); userEMail.setProperty("relUser", user.getKey()); gaeDatastore.put(userEMail); @SuppressWarnings("unchecked") CollectionemailList = (Collection ) user .getProperty("relSetUserEMail"); if(emailList == null) emailList = new ArrayList (); emailList.add(userEMail.getKey()); user.setProperty("relSetUserEMail", emailList); gaeDatastore.put(user);
沒有留言:
張貼留言