私はDatastoreインターフェイスでGoogle App Engineを使用しています。Googleのデータストアで重複するエントリ
エンティティを更新しようとすると、全く新しいエンティティが作成されます。これは私が肯定的であるにもかかわらず、同じエンティティを保存していることを意味します。
これは私のコードです:
Key key=KeyFactory.createKey("user",Long.parseLong(ID));
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Entity entity=new Entity("user",key);
entity.setProperty // ...whatever, updating the properties
datastore.put(entity); //by putting an entity it's supposed to
// either create a new one if non exists, or update an entity if it already exists
私は私の管理コンソールで確認されているように、キーがすべての更新の際に同じであることを確信しています:
id=3001 600643316
id=3002 600643316
id=3003 600643316
同じとエンティティの束キー(600643316)が作成されます。
あなたはその答えを受け入れたものとしてマークする必要があります。 – DTing