Reputation: 4474
I'm using Java and I want to use Datastore with App Engine. Which API should I use?
There is 'com.google.cloud.datastore' and there is 'com.google.appengine.api.datastore'
More specifically there is 'com.google.cloud.datastore.Entity' as well as 'com.google.appengine.api.datastore.Entity'. How do I decide which one to use?
Edit: I'm using Java 8 and App Engine standard. I'm also using Eclipse and Cloud tools. When I add Library using 'Google Cloud Platform Libraries', jars for both are added. See: https://cloud.google.com/eclipse/docs/libraries
Upvotes: 0
Views: 148
Reputation: 178
The endpoints you mentioned are for the API and the Client Library:
com.google.appengine.api.datastore -> The API is specifically designed to work from Apps deployed on AppEngine.
com.google.cloud.datastore -> The Client Library could be used form any Application.
You can see the main difference of them here. Nonetheless,the way of calling DataStore would be mostly based on your environment (i.e Java8, Java7, AppEngine Standards/Flex, external applications).
Same applies for the Entities. One is for creating Entities with the API, the other one with the methods from the Client library.
Upvotes: 1