Book Review – Hibernate Tips: More than 70 solutions to common Hibernate problems, by Thorben Janssen / @thjanssen123

If you ever used Hibernate in your life and never had a look at this book, I have to tell you: you could be doing something in a not so good way. Or, worse, in a wrong one.

thorben-book

First of all, let me tell you about the author. If you have no idea who Thorben Janssen is, you are really missing great content sharing by a great guy. With almost two decades of experience, he is blogger, author (of course!), trainer and consultant. He has been using Hibernate almost from the day one and has a lot to teach.

So have a break now and go follow him on Twitter: https://twitter.com/thjanssen123.

The book is made for developers with at least some basic knowledge of JPA and Hibernate. It is focused to help them with common tasks and problems, from the most basics to the most advanced ones.

The book is structured in a way that’s impossible you don’t find what you are looking for:

  • Setting up
  • Basic Mappings
  • Advanced Mappings
  • Hibernate Specific Queries and Mappings
  • Java 8
  • Logging
  • JPQL
  • Native SQL Queries
  • Create queries programmatically with the Criteria API
  • Stored Procedures
  • Caching

And inside each topic you will find tons of solutions. Actually, 70 in total! 😉

Each solution (may I call it a “recipe”?) use a “problem -> solution” approach: a common problem is described and a solution is showed up. With code! Thank you, Thorben!

Then you can download the full source code of the solution and get more information in the “Learn More” section.

With simple and “straight to the point” explanations, the book helps you to understand that crazy code that your IDE generates when you use some wizard to create entities from the database.

The texts are concise, clear and very well written.

Some of my favorite solutions:

  1. From the Basic Mappings section, all solutions dealing with primary key values. Yes, it is basic… but also still bring some pain to many developers due to the different ways it can be done. So those recipes are like gold;
  2. From the Advanced Mappings section, the solution that show how to calculate entity attributes using @Formula annotation;
  3. The whole Java 8 section!
  4. Cache section, specially because I discovered something that I was doing wrong… thanks again, Thorben!

That’s my impression of the book. Have you ever read it? If so, leave your comments here and share yours.

Are you a Hibernate/JPA developer and didn’t read it? Oh, come on… 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *