Yes you can do it. Whenever you need to get an identifier, you can use the following method call. Suppose you are using a User entity class object named User : user.getKey().getId() . The identifier is of type long . For more information, see JavaDoc com.google.appengine.api.datastore.Key .
Whenever you have an ID, you can build a Key from it and then just query the object.
Key key = KeyFactory.createKey("User", id); DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); User user = datastore.get(key);
Benjamin muschko
source share