[appengine-java] How do I query by key?

2012-03-22 Thread Aribar Hunter
I feel stupid. I've looked over lots of documentation, I've tried Google searches, I've searched on other sites like Stackoverflow, and I just don't understand this. I have a site that allows the user to access profiles of imaginary people containing information like names and descriptions. I

Re: [appengine-java] How do I query by key?

2012-03-22 Thread Jeff Schnitzer
Let's say you have a Profile entity with an id of 123. The easiest way to retrieve it is to use DatastoreService.get(), not a query. Construct a Key and pass that to get(): DatastoreService ds = DatastoreServiceFactory.getDatastoreService(); Key key = KeyFactory.createKey(Profile, 123L); Entity