The release of Hibernate 6.0 marks a milestone for the development of JPA 3.x
Hibernate 6 is out!
Congratulations are in order for the Hibernate development team – Hibernate 6 is a ton of work.
What’s new in Hibernate 6?
There’s a lot to like here – they’ve put a lot of effort into a lot of areas that most users honestly won’t notice, or want to notice – but overall Hibernate is stronger than it looks. was, and they managed to do all of this without changing Hibernate’s surface much at all.
That’s a good thing – because it means you as a developer get a better version without having to go through a ton of update shenanigans. There may be a few changes here and there, especially for those who really take advantage of Hibernate’s strengths, but for most users this is usually a very light update.
Hibernate and JPA
Hibernate is one of the first libraries you think of in Java when considering relational database access, and there are very good reasons for that.
The thing is, Java has JDBC built in, and JDBC is pretty good for what it’s designed for: it provides access to Java’s relational schemas in a standard way. A given relational database may have its own variations of SQL, but talking to a database in the general sense is trivial.
However, relational models and object models are simply not the same. A relational model is more like a spreadsheet, and an object model is closer to how we think about things in the real world.
We don’t think “there are seventeen doors” and “there is my house” and “maybe one of these doors is the front door to my house” – we think “I have a house, and my house has a front door,” and maybe “…and here is my front door.
Simplified data persistence
JDBC gives us the “seventeen gates” perspective, and Hibernate converts it into the second model, which is not only more appropriate for humans, but is more appropriate for Java itself.
There are costs and conventions, of course. Designing an object model is often more akin to designing a graph, and mapping a graph in a database can have negative performance implications, which gave JPA a bad reputation with some practitioners. But it’s not hard to design an object model for effective use with JPA; all it takes is some research and institutional knowledge, both of which are readily available for Hibernate, given that it has been around for twenty years now.
Scalability issues, native data structure access for specific database dialects, common performance issues related to simplistic usage: all issues that have solutions ready and fully documented in the Java community.
With the new release, Hibernate gets better performance, new features, better support for newer versions of Java, and a great path for future development – all features that create a compelling update.