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.

Entities stored in the database typically have relationships with other entities. Chapter 4, “Relationships, JPA, and advanced persistence,” provides guidance on how to define and manage entity relationships using JPA. We’ll also look at reverse engineering JPA entities and adding a service layer, which is a new feature added in a recent release of Roo. Not all types of data are good candidates to store in a relational database. This is where NoSQL databases come into the picture; these nonrelational databases have been getting a lot of attention lately. You’ll learn how to persist data into a NoSQL database like MongoDB.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.190.182