데이터 저장소 인터페이스가있는 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