Java Persistence Architecture (JPA) is the Java EE standard for mapping POJOs to a relational database. In this example we will use JPA to interact with our database data we set up in part 1. In the previous post we specified the mapping metadata as annotations. This post will demonstrate how to specify the same metadata as XML. One advantage of specifying the metadata as XML is that the domain objects will not have a dependency on the JPA APIs. This is useful if we want to use the same domain classes on the client side.
- Part 1 - The Database
- Part 2 - Mapping the Database to JPA Entities
- Part 3 - Mapping JPA entities to XML (using JAXB)
- Part 4 - The RESTful Service
- Part 5 - The Client