Hey guys,
SimpleDS is a Java persistence framework for GAE (think Objectify, but different). This release includes the following:
Serialize attributes as JSON
Something similar to what NDB introduced lately, you can choose between @Embedding a composite object or serializing it @AsJSON:
@Property @AsJSON
private AcmeObject myObject;
These fields get stored as Text attributes, which means that you cannot include them as query arguments (not that it would make any sense). We are using Jackson for JSON serialization/deserialization, so you can use anything in org.codehaus.jackson.annotate.
Predicates
Guava Predicates are now easier to use than ever:
@Override
public CursorList<Whatever> findByUser(Key userKey, boolean includeOldData, Cursor cursor) {
return entityManager.createQuery(Whatever.class)
.equal("userKey", userKey)
.withPredicate(includeOldData? null : new Predicate<Performance>() {
@Override
public boolean apply(Whatever input) {
return !input.isOld();
}
})
.withStartCursor(cursor)
.sortAsc("date")
.asCursorList(20);
}
This should save you some indexes in your datastore, and is a great way to implement filters based on a condition (such as the example above). As with anything else, setting the predicate to null is just a no-op.
Predicates are supported for any method that returns List, CursorList, CursorIterable and CursorIterator instances.
Demo app
Removed dependencies
We have reduced the list of dependency JARs required to deploy. JPA annotations are not supported anymore, and you do not need any Spring JARs anymore. The only two required dependencies that remain should be jackson for JSON serialization and slf4j for logging.
Next in our roadmap: async operations and get partial entities (hopefully, with a shorter release cycle).
Merry Christmas to everyone!