I am recreating my Python server in Java, here is the specific python
section I'm stuck on:

--
class AddThread(webapp.RequestHandler):
    def post(self):

        catKey= db.Key(encoded=self.request.get('catKey'))

        cats = db.GqlQuery("SELECT * FROM Category WHERE ANCESTOR IS :
1 ORDER BY date DESC",catKey)

        thread = Thread(parent=cats[0])

        thread.author = self.request.get('author')
        thread.title = self.request.get('title')
        thread.put()
--

So far, my Java version is:

--
public class AddThread extends HttpServlet {
    private static final Logger log =
Logger.getLogger(AddThread.class.getName());

    public void doPost(HttpServletRequest req, HttpServletResponse
resp)
                throws IOException {

        Key catKey= stringToKey(req.getParameter("catKey"));

        Query query = pm.newQuery("SELECT FROM Category WHERE ANCESTOR IS
"+catKey+" ORDER BY date DESC");

        List results = (List) query.execute();
--

However, how do I then create the Thread object with the parent being
the first (and only) object in the results list? The documentation is
really confusing to me, it seems much more complicated than the python
equivalents..
Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to