本部分中的页面介绍了如何通过 App Engine API 访问 Datastore。使用这些 API 的应用只能在 App Engine 中运行,并且必须升级到推荐的 Google Cloud API 才能迁移到较新版本的 App Engine 运行时环境。推荐的 Datastore API 包含在 Google Cloud 客户端库中,让应用可在 App Engine 中以及其他支持 Java 8 的环境中运行。
搭配使用 Objectify 与 Datastore
您可以使用 Objectify 访问 Datastore,而不是使用 App Engine API 或 Google Cloud API 来访问。Objectify 是 Cloud Datastore 的开源 API,可提供比 App Engine API 和 Google Cloud API 更高的抽象级层。使用早期版本的 Objectify 的应用只能在 App Engine 中运行,但使用版本 6 及更高版本的应用可以在 App Engine 以及其他支持 Java 8 的环境中运行。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-06。"],[[["This API is designed for first-generation runtimes and is relevant when upgrading to second-generation runtimes."],["Apps using these App Engine APIs can only run in App Engine and must upgrade to the recommended Google Cloud APIs before migrating to newer runtimes."],["The Google Cloud Client Library is the recommended API for Datastore and allows apps to run in App Engine and other environments."],["Objectify, an open-source API, offers a higher-level abstraction for accessing Datastore, and version 6 or later can run in multiple environments."],["While Objectify is mentioned, Google Cloud Platform does not provide direct support for this third-party library."]]],[]]