Chapter 7. Models and persistence

This chapter covers

  • Defining data models
  • Persisting data
  • Mapping your model using JPA annotations
  • Loading initial data
  • Querying data using Ebean

In the previous chapters, we covered the basic requirements for our paper clip warehouse application. Until now, we’ve been faking data storage by maintaining static Lists in memory. Now it’s time to start saving our data in a database. We’ll take a closer look at our data model, and learn more about the role of a data model in a Play application.

First things first?

Although it seems to be convention in most application frameworks to start with the data model, Play doesn’t dictate where you start developing your application; if you want to start ...

Get Play for Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.