O'Reilly logo

Play for Java by Nicolas Leroux and Sietse de Kaper

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required