David Chandler's Journal of Java Web and Mobile Development

  • David M. Chandler

    Web app developer since 1994 and Google Cloud Platform Instructor now residing in Colorado. Besides tech, I enjoy landscape photography and share my work at ColoradoPhoto.gallery.

  • Subscribe

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 224 other subscribers
  • Sleepless Nights…

    October 2009
    S M T W T F S
  • Blog Stats

    • 1,040,366 hits

Archive for October 17th, 2009

AppEngine DataStore learnings

Posted by David Chandler on October 17, 2009

Just a couple quick notes to round out the week and serve as placeholders for future entries. I’m using AppEngine for Java with JDO. I’ve modeled a few foreign key relationships (unowned per Google parlance) and have been saving things to the DataStore in production with success so far.

  1. Use pm.detachCopy() to return objects back to the client. You don’t have to use detachable=”true” in the @PersistenceCapable annotation in order to use pm.detachCopy(). In fact, I couldn’t get it to work with detachable=”true”.
  2. Use pm.detachCopyAll() and create a new collection to return query result collections back to the client. Will post sample code soon.
  3. Use Adapter4AppEngine or other technique to enable use of Key fields in objects exchanged with GWT as I blogged a couple days ago.
  4. Create Keys on the server because GWT doesn’t know what KeyFactory is. To create relationships, your services (action handlers in gwt-dispatch) should accept as arguments the IDs of related objects (or the objects themselves) and then pass the IDs to KeyFactory in the service or action handler to create actual keys.

Upcoming topics for GWT:

  1. How to create a centered “Loading…” popup panel for actions in progress.
  2. A technique for navigating to new pages with gwt-presenter by swapping out DIVs.

Posted in AppEngine, Google Web Toolkit | Leave a Comment »

%d bloggers like this: