Book Reviews
This book review was submitted by a DenverJUG member as part of the Book Review Program.BOOK DETAILS
Hibernate in Action
Authors: Christian Bauer and Gavin KingPublisher: Manning Publications
Publish Date: August, 2004
Pages: 400
ISBN: 193239415X
Publisher's Book Description
Review Date: October, 2004
REVIEWER
Jeff WangREVIEW
Ever since its birth, Hibernate has been the darling for enterprise developers who have to survive the OR (object/relational) paradigm mismatch. There have been other attempts to resolve the notoriously difficult problem, including the "official" solution from Sun, Java Data Object. But now the popularity and effectiveness of Hibernate have people talking about scratching JDO (poor JSR 12!).Hibernate in Action is one of the "in Action" books from Manning, and written by the authors - the authors of the Hibernate package that is. By default they know what they are talking about. So the contents of the book are factually accurate. And they also know what you need to know, to take advantage of what Hibernate offers. Thus the book is practically useful.
Moreover, if you are interested in the next version of EJB, you'd find out that it has heavy Hibernate flavor (with POJOs). In fact, the lead architect of the EJB team wrote the forward for this book.
Intended Audience
The intended audiences of this book are Java developers working with relational database, and DBAs dealing with Java developers.
The Contents
As "the Bible of Hibernate" (Ara Abrahamian), this book is surprisingly thin. It has 408 pages, nine chapters and three appendices.
The first chapter "Understanding object/relational persistence" provides an overview on data persistence, an explanation of the object/relational paradigm mismatch, and an introduction to the concept of ORM (object/relational mapping). Although most people working with enterprise applications understand the issue, the smooth and systemic summary is still a nice read.
"Introducing and integrating Hibernate", Chapter 2, follows the time-honored tradition, and starts with "Hello World" example using Hibernate. Then it offers a high level overview on Hibernate architecture and configurations.
The rest of the book covers Hibernate APIs and best practices that teach you how to build enterprise level applications with Hibernate.
Chapter 3, "Mapping persistent classes," concentrates on the "structural aspect" of the OR mismatch. It discusses the POJO domain model, separation of persistence issues from domain model, mapping metadata, and mapping strategies.
Chapter 4, "Working with persistent object," moves to the "dynamic aspect" of the OR mismatch. It discusses the object lifecycle, introducing the three object states defined by Hibernate, the transition between states, and the object retrieval.
Any large scale application has to consider the following topics: "Transactions, concurrency, and caching," which are what Chapter 5 covers. This chapter discusses the two Hibernate transaction concepts, the strategies of isolation levels, demonstrating how transactions are managed by Hibernate. Then the chapter explains the caching mechanism provided by Hibernate, and a practical guide.
Chapter 6, "Advanced mapping concepts," picks up where Chapter 3 left, and pushes the discussions on mapping further. It introduces the Hibernate type system, and how to use custom mapping types, collection mappings, one-to-one and one-to-many associations. For content management developers, this chapter is a must-read.
Chapter 7 pretty much covers everything about HQL (Hibernate Query Language), and optimization of the retrieval of the association objects.
Chapter 8, "Writing Hibernate applications," is about how to design an application using Hibernate.
The last chapter, "Using the toolset," discusses the development process for Hibernate applications, the tools provided by Hibernate, and the tools that can be used with Hibernate.
The appendices cover some basic concepts and suggestions.
Overall, if you are working with, or want to learn, Hibernate, this is the book to have.
