My favorites | Sign in
Project Home Downloads Wiki Issues Source
Using Objectify with Google Web Toolkit
en, fr
Updated Apr 4, 2014 by

Starting with version 4.1, GWT integration has been separated from the core objectify.jar and moved into a separate project. Please visit:

Note that these projects are versioned separately and released on a separate schedule.

Comment by, Apr 22, 2010

This must be the most common request in relation to new 'things' on the web.

Please, please, please create a simple, fully working, example. This will save hours of frustration trying to understand your documentation when a working example makes it so much easier. Maybe just populate a grid with a list of cars, edit one, and save it. It's impossible to adopt Objectify if we can't get it to work.


Comment by, Jun 8, 2010

I didn't have much trouble getting it to work pretty generically but it was tricky kinda.

The big thing is any entity you want to pass back has to implement the GWT IsSerializable? interface and follow its rules (have a blank constructor, etc).

The nice part about that is you can make your RPC servlet methods generic using Key<IsSerializable> and IsSerializable?.

The way I have it set up is I have a Data servlet (RPC) that GWT interacts with. It passes Keys or Strings to search for or whatever to the various methods, and there're a couple 'getAll' methods for some objects e.g. Map<Key<IsSerializable>, IsSerializable?> getAll(Class class) or something along those lines.

Comment by, Jun 26, 2010

this is a really nice tool for gwt. but please create a simple example! it's so much easier to understand objectify by playin around with an example than reading a documentation!

thank you!

Comment by, Aug 26, 2010

it sounds good but need an example

Comment by, Sep 4, 2010

Where is an Example? please!

Comment by, Nov 8, 2010

Mmm, you say no more DTO's. Looks true when you only use primitive types or build-in Objectify classes, but what about loading an entity in an entity?

class Contact { ... Key<Address> address }

When I show a Contact, I want to show the Address as well, but that's impossible. They key itsself is terribly useless on the GWT side, so I'll have to build a DTO anyway, right?

Comment by project member, Nov 8, 2010

There are a couple ways around this. One is to build a DTO, another is to include a @Transient Address object on your entity and populate it before you send your Contact to the client.

Comment by project member, Nov 8, 2010

By the way, unless you're deconflicting Address objects and sharing them among Contacts, you almost always want to use @Embedded or @Serialized for little dependent objects like this. This is one area where GAE-based application design and RDBMS-based application design differs.

Comment by, Nov 8, 2010

Yes I doubted including a @Transient object, however then it makes slightly more sense to make a Dto anyway. I'll try the @Embedded way, tnx.

Comment by, Nov 24, 2010
Comment by, Apr 30, 2011

There is a change in Objectify version 3.0, which affects the creation of Key<T> objects on client side. This change is discussed here:

You'll receive a GWT compiler error saying: "The constructor Key<T>(Class<T>, ...) is undefined"

Comment by, Jul 24, 2011

I may not be quite knowledgable enough to understand why the Key<T>(Class<T>, ...) constructor doesnt work anymore. Is there some alternative way of setting the key attribute for my objects? For example, I have this code inside my "" constructor: public void setParent(String key) { parent = new Key<Parent>(Parent.class, key); } How do i refactor that to work with 3.0? or am i just better sticking with 2.2.3 and waiting for these issues to be fixed in a future release

Comment by, Jul 28, 2011

You could store the key as a string instead of an actual key object if you want to keep that design. Then you can construct the key on the server when you need it.

Comment by, Nov 10, 2011


Objectify 3.0.1 with GWT 2.4, GAE 1.5.5

Development mode exception com.googlecode.objectify.impl.ObjectifyImpl?

while it works fine in production mode.

Any suggestion...

Comment by, Oct 24, 2013

The very simple example given still uses javax imports and requires DataNucleus? inclusion and doesn't actually do a datastore write/read.

Is there a simple GWT-Objectify example that actually uses the datastore and does not use javax. ?

Sign in to add a comment
Powered by Google Project Hosting