참고: Java 8은 2024년 1월 31일 지원 종료되었습니다. 기존 Java 8 애플리케이션은 계속 실행되고 트래픽을 수신합니다. 그러나 지원 종료 날짜 이후에는 해당 런타임을 사용하는 애플리케이션의 재배포를 App Engine에서 차단할 수 있습니다.
지원되는 최신 Java 버전으로 마이그레이션하는 것이 좋습니다.
Datastore의 데이터 객체를 항목이라고 하며, 각 항목은 쿼리를 위해 특정한 종류로 분류됩니다. 예를 들어 인사 관리 애플리케이션을 작성하는 경우 각 직원을 Employee 종류의 항목으로 나타낼 수 있습니다. 항목 데이터 값의 형식은 속성이라는 점에 유의하세요.
항목에 대한 자세한 내용은 항목, 속성, 키 개념 문서를 참조하세요.
항목 생성 및 속성 설정
Java에서는 Entity 클래스의 인스턴스를 생성하면서 Entity() 생성자에 항목 종류를 인수로 제공하여 새 항목을 만듭니다. 필요한 경우 항목 속성에 값을 채운 후 DatastoreService.put() 메서드에 인수로 전달하여 Datastore에 저장합니다. 항목의 키 이름을 지정하려면 생성자의 두 번째 인수로 전달하면 됩니다.
다음 예시에서는 Employee 종류의 항목을 만들고, 속성 값을 채우고, Datastore에 저장합니다.
이러한 일괄 작업에서는 모든 항목 또는 키를 항목 그룹으로 묶은 후 요청된 작업을 각 항목 그룹에 대해 병렬로 수행합니다. 이 방식은 서비스 호출에 따르는 오버헤드가 한 번만 발생하므로 개별 항목을 일일이 따로 호출하는 방식보다 속도가 빠릅니다. 일괄 처리에 여러 항목 그룹이 사용되는 경우 서버 측에서 모든 그룹에 대한 작업이 병렬로 수행됩니다.
put() 또는 delete() 일괄 호출은 항목에 따라 성공적으로 작동하거나 그렇지 않을 수 있습니다.
호출이 완전히 성공하거나 완전히 실패하는 것이 중요한 경우에는 모든 항목이 동일한 항목 그룹에 포함된 트랜잭션을 사용하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-06(UTC)"],[[["This API supports first-generation runtimes and can be used when upgrading to corresponding second-generation runtimes, with a migration guide available for App Engine Java 11/17 runtime updates."],["Entities are data objects in Datastore, categorized under a specific kind for queries, with properties defining their data values."],["Entities are created in Java using the `Entity` class and saved to Datastore via the `DatastoreService.put()` method, and can be named with a key or given an automatically generated numeric ID."],["To update an existing entity, modify its attributes and use `DatastoreService.put()`, overwriting the existing entity, while `DatastoreService.delete()` is used to delete entities based on their keys."],["Batch operations allow multiple entities to be handled in a single Datastore call, improving efficiency by grouping entities by entity groups and performing operations in parallel."]]],[]]