This document discusses deploying a Play! application called BookShelfs to different platforms using different databases and persistence frameworks. It compares deploying to Google App Engine using Siena and the GAE datastore, and deploying to Heroku using Siena with PostgreSQL or MongoDB. Code samples and URLs are provided for BookShelfs deployed in each configuration.
42. DB Index (1/3)
•GAE filter, order
Query Index
-> deploy
→ datastore-indexes-auto.xml
43. DB Index (2/3)
List<Borrow> borrows =
Borrow.all().filter("borrowerUserId",userId)
.filter("status ", BookStatus.RETURNED)
.order("-createdAt")
.fetch();
Index
44. DB Index (3/3)
•Siena PostgreSQL
Index annotation
Index
→ Index
?
→ (fullscan, sort)
58. Morphia
package models;
import play.data.validation.Email;
import play.data.validation.Required;
import play.modules.morphia.Model; Morphia Model
import play.modules.morphia.Blob;
import com.google.code.morphia.annotations.Entity;
@Entity
public class User extends Model {
@Email
@Required
public String email;
@Required
public String password;