File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -142,16 +142,15 @@ <h4>Example: Retrieve Datastore Entries</h4>
142142import com.google.gcloud.datastore.Key;
143143import com.google.gcloud.datastore.KeyFactory;
144144
145-
146145// Authentication is automatic inside Google Compute Engine
147146// and Google App Engine.
148147DatastoreOptions options = DatastoreOptions.builder().build();
149-
150148Datastore datastore = DatastoreFactory.instance().get(options);
151149KeyFactory keyFactory = datastore.newKeyFactory().kind(< span class ="hljs-string "> KIND</ span > );
152150Key key = keyFactory.newKey(keyName);
153151Entity entity = datastore.get(key);
154152
153+
155154</ code > </ pre > </ div >
156155
157156 < div hljs ="" language ="java " ng-show ="selected == 'elsewhere' " class =""> < pre >
@@ -167,7 +166,6 @@ <h4>Example: Retrieve Datastore Entries</h4>
167166 .projectId(< span class ="hljs-string "> PROJECT_ID</ span > )
168167 .authCredentials(AuthCredentials.createForJson(
169168 new FileInputStream(< span class ="hljs-string "> PATH_TO_JSON_KEY</ span > ))).build();
170-
171169Datastore datastore = DatastoreFactory.instance().get(options);
172170KeyFactory keyFactory = datastore.newKeyFactory().kind(< span class ="hljs-string "> KIND</ span > );
173171Key key = keyFactory.newKey(keyName);
You can’t perform that action at this time.
0 commit comments