Part 2. Databases and entities
In part 1, you learned how Roo aids in rapid Java application development. Most real-world enterprise software applications use some type of database to store and retrieve business data to display on user interface screens. Data persistence and data access are the main topics of part 2.
In chapter 3, “Database persistence with entities,” we’ll explore database persistence using the Java Persistence API (JPA), and you’ll learn how to set up JPA in a Roo application. You’ll also learn how you can create entities and add fields to those entities, and you’ll write a JUnit test to test the Roo entity you created. Validation is another important aspect of keeping data in the database clean. We’ll discuss how to enable data validation using the Bean Validation Framework to configure automatic data validation in your entities. Then, we’ll discuss search finders. We’ll finish chapter 3 by discussing how to create repositories in Roo, including the features of Spring Data JPA.