My team is about to build a new product and we are using Hibernate/JPA as the persistence mechanism. There are other book posts on stackoverflow, but I couldn't find one that matched my needs.
My manager will be purchasing books for our team to use as a resource so...
What are the best books about Hibernate and JPA?
(Please list each book suggestion in a separate answer)
(If you already see your book answered, instead of adding it again, just vote it up)
Source: Tips4all
Java Persistence with Hibernate is the new edition of Hibernate in Action. It includes all the 3.x features, including JPA, and offers a bonus chapter on Seam, so don't get the old edition :-).
ReplyDeleteThey should really call this book "The Actual Documentation for Hibernate". I'd been using Hibernate for 2 years prior to reading it, and I thought I knew what I was doing, but this book made me realize I'd only skimmed the surface.
This book was co-authored by Gavin King, the author of Hibernate. It's the closest thing to a "Hibernate bible" that you're going to find.
"Java Persistence with Hibernate" sucks. It's from 2007 and still mostly using XML. It was only updated in a way to complement with annotations. You always get the explanation in XML and a very unmotivated "here's the same using annotations". Yawn. I bet anybody new to Java persistence will dump XMhell due to annotations, at least for non-legacy systems.
ReplyDeleteThe book is rather disorganized and fails to be used as a reference. Most people starting to learn Hibernate likely have one or more existing DBs somewhere that they just want to get to work with Hibernate without having to read hundreds of (sometimes repetitive) pages. (The book has more than 800...)
Besides that, "Java Persistence with Hibernate" doesn't cover many advanced mappings. You can see from the book that the authors didn't put much effort into discussing certain topics, like composite primary keys, because they put this topic under chapter 8 "... Legacy Databases". Composite primary keys only exist in legacy databases? Come on...
"Hibernate made easy" is expensive and useful in the beginning, but also misses more advanced stuff. It's not about JPA in this book.
The very best book clearly is Pro JPA 2 by Mike Keith (apress):
http://www.apress.com/9781430219569
He's the author of the JPA 2 spec and he really knows what he's talking about. Plus you get a lot more advanced mappings, e.g. composite primary key variants explained (@IdClass and @EmbeddedId). There are remarks about certain past issues in JPA 1.0, so you can learn what has really changed between JPA 1 and JPA 2.
2/5 stars for "Java Persistence with Hibernate", 3/5 stars for "Hibernate made easy", and a 5/5 stars for "Pro JPA 2", also because the author is actively supporting his book.
I am using the Java Persistence with Hibernate book. It is pretty thorough. I used an earlier version of this book (it did not have the JPA stuff) to learn how to use Hibernate myself from scratch. I am sure I have a lot more to learn, but I think its a good book.
ReplyDeleteThere is only one book that I can really recommend and that is JPA2 Pro. A must for every developer using JPA technology.
ReplyDeletehttp://apress.com/book/view/1430219564
Hibernate in Action is a bit outdated, but still worth the price. Java Persistence with Hibernate is bloated and not as focused.
ReplyDeleteAlso Hibernate Made Easy; Simplified Data Persistence with Hibernate & JPA Annotations is a good book.
ReplyDeletePro EJB 3: Java Persistence API is absolutely essential for working with JPA. It was written by one of the spec authors (Mike Keith), and I frequently refer to it. I keep it on my desk next to my computer at work.
ReplyDeleteIt's one of those books where your coworker asks you a question about JPA and then you look it up in the index and the answer is always right there in the text.
There is another very good book on JPA 2.0:
ReplyDeleteJava Persistence with JPA, by Daoqi Yang. It was recently published (April, 2010). The author claims being complete in the coverage of JPA 2.0, and being concise but with many examples. The author has a website to support this book: http://www.yangdaoqi.info/jpa.html
I found Hibernate: A Developer's Notebook by James Elliott very useful when I was first investigating Hibernate, but I guess it depends upon the experience level of your team with Hibernate.
ReplyDeleteI have that particular book, and while it is useful, wasn't it covering Hibernate 2.x which was modified quite a bit for the current 3.x release? (Not to say that it won't get you started, and quickly, but we should point out that it's relatively old.)
ReplyDeleteI knew NOTHING about hibernate and I even barely know enough about the Java language. my other team members started learning hibernate from most of the books mentioned here and it took them WEEKS to learn hibernate But I learned the basics needed to jump start with hibernate from this book: "Hibernate Made Easy".. I read most of it just in 1.5 work days. BEST thing to BEGIN with and then move on to other advanced books.
ReplyDelete"Hibernate in Action" is all time best book for Hibernate
ReplyDelete