How do I dynamically create class and persist it to the Google App Engine?
How do I create persist-able class dynamically and persist it to the Goo开发者_JAVA百科gle App Engine datastore
If you mean you don't know beforehand what fields/properties will be persisted then you can use the Datastore API to create and persist entities on the fly.
Entity entity = new Entity("User"); // specify the entity kind
entity.setProperty("name", "someuser"); // add some properties
entity.setProperty("email", "some@user.com");
DatastoreServiceFactory.getDatastoreService().put(entity); //save it
However if you actually want to create 'class' dynamically then this answer would not help.
精彩评论