Mike Keith and Merrick Schincariol authored a book which focuses on JPA 2, the Java persistence API which is now included in the Java EE 6 specification.
JPA has its origins in object relational mapping tools like hibernate, JDO or TopLink. While JPA was originally created as a standard for the Java enterprise stack, it did not take much time until it was was also used in the Java SE environment. JPA is easy to use and helpful if integrated into Desktop applications whenever object relational mapping makes sense.
While JPA is covered in Java EE books as well, Pro JPA 2 only focuses on JPA and provides a profound coverage of the topic, attracting all kinds of developers. The books does not require previous knowledge of JPA 1 or other object relational mapping technology. A basic understanding of database systems, SQL and JDBC is required, but the required knowledge can be achieved by using Wikipedia or any introductory article.
The book motivates the usage of ORM (object relational mapping) software by showing the differences to JDBC, proprietary APIs, EJBs, and JDO. After reading the first pages, you are already able to write your first JPA 2 application, getting an overview of the various parts of JPA, configuration and running the application in a Java SE environment. This is especially useful for beginners, who are able to understand how the different parts operate and are encouraged to try out the technology.
The third chapter provides a short introduction to Java EE and explains the role of JPA in the context of an enterprise application with an emphasis on transaction and dependency management. The following chapters focus on the many aspects of ORM, many UML diagrams help understanding the context. Advanced topics like caching, deployment, packaging and testing are covered as well, contributing to the good overall impression of the book.
The last chapter helps users who need to migrate from CMP entity beans, JDBC or other ORM solutions to JPA 2 and introduces related enterprise design patterns.
In a nutshell, the authors manage to satisfy both the needs of novice and experienced developers with a good introduction and an in-depth coverage.
I recommend the book to everyone who is using persistent storage in his applications. Persistence mapping eases development and JPA 2 is a mature and feature-rich API for the use in production and through various types of applications.
At various points the authors note the differences from previous JPA standard, so users who are forced to the old specification can be aware of incompatibilities.
If you are considering a migration from JPA 1 to JPA 2, you might want to know what you will gain:
What is new with JPA 2?
The main features included in the update from JPA are:
- Expanded object relational mapping functionality (support for collections of embedded objects, multiple levels of embedded objects, ordered lists)
- A criteria query API
- combinations of access types
- standardization of query-hints
- standardization of additional metadata to support DDL generation
- validation support
Title: Pro JPA 2: Mastering the Java™ Persistence API
Authors: Mike Keith, Merrick Schincariol
Amazon link: Pro JPA 2: Mastering the Java Persistence API
One thought to “Pro JPA 2 (Book review)”
I am currently reading this book and can recommend it to everyone who is interested in JPA 2.