SQL Zone is brought to you in partnership with:

Jason has posted 2 posts at DZone. View Full User Profile

Win Your Copy: Java Persistence with Hibernate

  • submit to reddit
Published by: Manning
ISBN: 1932394885

Reviewer Ratings




Buy it now

One Minute Bottom Line

Whether you are new to Hibernate and want to dive into your first project or are a Hibernate guru and need a reference manual to remind you of how to implement a conversation, this is the right book. The authors have really covered all the bases. Anything you want to know about Hibernate is in here.

I highly recommend this book to anyone needing to get started with Java and Hibernate!


This book is divided into 3 parts with 2 appendices.

Part 1: Getting Started With Hibernate and EJB 3.0

This is the foundation for understanding how Hibernate works. The most relevant part for me was selling me on "why Hibernate?" I've always been a "do it yourself SQL person". In chapter 1, I was sold. Forget ease of use. Forget performance and caching. The integration between Hibernate and EJB and the fact that JPA is becoming the standard was enough to make me take notice that this is a technology you cannot ignore if you are going to develop Java applications that use a relational database.

Chapter 2 helps you get going on your first project. Everything from creating the database to a preview of Hibernate annotations is covered.

Part 2: Mapping Concepts and Strategies

In an object-relational mapping solution you will soon find that how you map your objects in code is a lot of the challenge. While about 80% of the mappings that you do will be very simple, you will likely have some mappings that are more challenging and problematic.

Chapter 4 starts you out and delves into the simple to the advanced mapping topics you will need. This is a fantastic chapter and was probably the most useful one for me.

Chapter 6 covers mapping collections and is an essential foundation if you are going to be doing any sort of joins or other derived data sets in your mappings.

Chapter 7 goes into how those joins are accomplished in your mapping.

Chapter 8 covers what to do if you need to use an existing or legacy database. This is not just a "how do I use Hibernate with my existing schema" but it also explains some improvements that Hibernate can make to get more out of that legacy system. Very nice! Because we don't always get to start out with a clean slate!

Part 3: Conversation Object Processing

This was a rather new concept to me. I have always been used to managing transactions and session data myself. But the concept of a "conversation" was something that I have never considered until reading this section.

In chapter 10 transactions and concurrency are covered in dept. I was familiar with this part.

However, in chapter 11,  the conversation is introduced. The conversation is more than just using session data. It can include several transactions and other user actions.

If you want a lesson in efficiency and how to manage large sets of data, then chapters 12 and 13 are for you. Dynamic data filtering and caching were the most useful and interesting to me and if you are going to work with large data sets, I highly recommend spending some time understanding the concepts given here.

The rest of this part of the book and appendix A are all about query language, querying and the API and how they are used. This is a proportionately large section in the book and rightfully so because understanding this is fundamental to understanding Hibernate. After all, Hibernate must, at some point, create a query that is native to the database it is used with. Debugging such a thing can be difficult if you are unfamiliar with query concepts.

There is also part in chapter 16 that covers unit testing Hibernate code. If there is a negative aspect of this book, this is it. I don't think enough emphasis was given to this topic. However, unit testing is a fairly domain specific thing and I'm not sure that it could (or should) be covered in too much depth. After getting to this point, you should take what you have learned about Hibernate and apply your own knowledge of unit testing.

Appendix A: SQL fundamentals

This appendix is just that: fundamentals. It gives you enough information to understand what SQL is and some fundamental concepts but is in no way meant to be (nor could it be) a comprehensive overview of SQL. If you want an in-depth study of SQL, grab a database like MySQL and the manual and get to it!

The book index is probably your best friend when it comes to reference information especially when you have an idea about an annotation that you want to use but can't quite remember where it was or how it was spelled, etc. I loved the index to this book! What a huge help!

For more information about the author and this book click here.

Click here to see all 46 DZone Refcardz and cheat like a PRO! 


Published at DZone with permission of its author, Jason Kilgrow.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Jens Morris replied on Fri, 2009/04/03 - 11:16am

I think hibernate is a brilliant tool. It is less important after the arrival of JPA, but still very usefull. Good review, makes me want to read this book :-)

Jens Morris replied on Fri, 2009/04/03 - 11:23am

Hibernate is brilliant, less important after arrival of JPA, but still very usefull.
Good review, makes me want to read this book :-)

Zaheer Paracha replied on Mon, 2009/04/06 - 3:40pm

I have good read good reviews about this book. Will be a good book to help me in my current project involving Spring and Hibernate.

Wei Ling Chen replied on Fri, 2009/04/10 - 10:39am in response to: Todd Cosgrove

Thank you for your comments everyone. I'm proud to announce Todd Cosgrove is our lucky winner for this book. 

Stay tune for more book reviews and giveaways. 



Gaurang Patel replied on Tue, 2009/04/21 - 4:54pm

Hibernate is a greate ORM (object relation mapping tool), which reduces burden of writing JDBC code. Because of ORM packages like hibernate devloper can concentrate on core business logic rather than manipulatic JDBC code (converting result set data in to java object and vice versa). It supports great features like caching of object in memory, HQL and many mores. Sun has release JPA standard in ejb3 based on populariy of Hibernate. In one line "Hibernet makes devloper to concentrate on business logic rather than righting jdbc handling code"

Manu Lorenz replied on Tue, 2009/06/09 - 3:40am

I've used hibernate with springframework in a j2ee application ... that's more easier thus

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.