Today we released version 2.0 of Objectify-Appengine. Objectify is a "mid-level" persistence API for the Appengine datastore - much simpler than JDO, much more sophisticated than the Low-Level API, much easier to use than either!
http://code.google.com/p/objectify-appengine/ If you are unfamiliar with Objectify, the core bullet points are: * Objectify lets you persist, retrieve, delete, and query your own typed objects. * Objectify surfaces all native datastore features, including batch operations, queries, entity groups, and unindexed properties. * Objectify provides type-safe key and query classes using Java generics. * Objectify provides a human-friendly query interface based on GAE/Python's Query class. * Objectify does not impact application cold-start time, adding a few milliseconds at most. * Objectify can automatically cache your data in memcache for improved read performance. * Objectify provides a simple, easy-to-understand transaction model. * Objectify provides built-in facilities to help migrate schema changes forward. * Objectify entities can be used in GWT without the need for Data Transfer Objects. * Objectify has no external jar dependencies. Just add objectify.jar to your project. * Objectify provides thorough documentation of concepts as well as use cases. Version 2.0 introduces several major new features: ==== A new, even friendlier query API ==== The query API now works *very* much like GAE/Python: Objectify ofy = ObjectifyService.begin(); Car car = ofy.query(Car.class).filter("vin =", "123123123").get(); Query<Comment> query = ofy.query(Comment.class).filter("rating >", 3).ancestor(blogEntry); for (Comment com: query) { ... } for (Key<Comment> key: query.fetchKeys()) { ... } ==== @Cached entities ==== Just put @Cached on your entity class and they will automatically be cached in the appengine memcache service for faster, efficient reads! @Cached public class MyEntity { @Id Long id; ... } The Objectify cache has several advantages over the public CachingDatastoreService: * Objectify caches negative results as well as positive results. * Objectify works correctly with transactions, bypassing the cache for reads and only writing on successful commit. * Objectify allows you to turn on caching and specify a cache expiration period on a per-entity basis. ==== @Embedded classes and collections ==== You can embed classes and collections of classes in your entities in an indexed, queryable way. An example: public class DeepData { String foo; int bar; } public class ShallowData { @Embedded DeepData[] deep; // or List/Set/whatever } public class MyEntity { @Id Long id; @Embedded ShallowData shallow; } You can query for instances of MyEntity that contain particular values of 'bar' like this: Objectify ofy = ObjectifyService.begin(); Query<MyEntity> query = ofy.query(MyEntity.class).filter("shallow.deep.bar >", 5); for (MyEntity entity: query) { ... } @Embedded classes and fields can be @Unindexed to eliminate indexing overhead. You can nest any number of embedded classes, although you cannot nest any kind of collection inside embedded collections. Unlike serialized classes, an @Embedded object graph is plainly visible inside the datastore viewer and is plainly available to other languages including GAE/Python. ==== @Serialized classes and collections ==== If @Embedded is too restrictive and you don't need portability or queryability, you can annotate any field with @Serialized. This can be mixed and matched with @Embedded to allow you to store collections inside an @Embedded collection. ==== Full support for datastore types (Email, Link, GeoPt, etc) in GWT ==== We provide source for all the basic datastore types in our GWT module. You can use this even if you aren't using Objectify's persistence code! ==== A big thanks to the rest of the Objectify team: Matt, Scott, and Jon! http://code.google.com/p/objectify-appengine/ Jeff -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.