Updated May 30, 2023
Introduction to Hibernate Versions
Hibernate is the Object Relational Mapping framework that helps map an object-oriented domain model to a relational database. The first hibernate version was developed in 2001 by Cirus Technologies by Gavin King to provide more persistent capacity than those of EJB2. Later, various hibernate versions were launched, adding extra features. When Hibernate 2 was launched, they added extra features to the first version. Later, 3.0 or 3 series launched with new interceptors, filters, and JPA specifications features. Hibernate 4.0 and 4 series launched with features like multi-tenancy, advanced session management, JPA 2.1 specification, and many more. With Hibernate 5.0 and higher version launched with bootstrapping, Entity Graph functionalities, support with latest java versions, and many more.
Top 6 Hibernate Versions
Following are the different versions of hibernate.
1. Hibernate 3.0
They developed it to support Java 1.5 version with full-featured query facilities and enhanced EJB3 persistence.
Features of Hibernate 3.0:
- Provided API with enhanced Hibernate query criteria and support for the queries expressed in the Native SQL dialects of the database.
- Added filters while working with temporal or regional data.
- Enhanced query API, which supports projection and subselects.
- Adding JMX or Local Java APIs enables runtime performance monitoring in this version.
- Dual-layered architecture helps in working with clustered architecture.
- Automatic key generation- hibernate automatically generates primary keys for tables.
- Inbuilt functionality of OOPs concepts.
- Hibernate 3 works with JDK 1.3 and higher versions up to JDK 1.5.
2. Hibernate 4.0
Hibernate 4, released in 2011, introduced several new features, including multi-tenancy support, service registry, SessionFactory clean-up, auto-discovery, and full i18n support.
Features of Hibernate 4.0:
- Multi-tenancy supports the separation of clients in big applications instead of shred space. Hence improved security and improved management.
- An added feature of a new way of accessing Session Factory after combining existing services in the framework of a single record.
- Adequate framework for OSGi Open Service Gateway Initiative platform that divides the classes into each package into three categories – Public, Internal, and SPI.
- The user can specify when an object should be considered dirty in Hibernate, thereby enabling the verification of dirty objects.
- Full support of i18n helps internationalization log messages using Jboss logging.
- This version works on JDK 1.6 and JDBC4.
- Introduction of new Service Registry.
- Inbuilt cleanup code deprecated methods and interfaces.
3. Hibernate 4.3.0 with JPA
Hibernate ORM 4.0.3 comes with fully JPA 2.1; this version can be used with JDK 7-based applications. This version is a certified version of full JPA 2.1 specifications. It supports stored procedures, batch updates, etc.
Features of Hibernate 4.3.0:
- Added with the feature of a stored procedure.
- Support to executing update and delete queries in type-safe Criteria. This helps in executing CriteriaUpdate and CriteriaDelete.
- This version support for attribute converters.
- Dependency injection through Contexts of Dependency Injection.
- Added with Entity Graph Support.
- The developers supported the result set mapping using native queries by adding @ConstructorResult.
- Support synchronization contexts through SynchronizationType.
- Supports standardized schema generation.
4. Hibernate 5
It is one of the major updates in hibernating ORM fully supported features of the Java 8 version. This release has major important feature improvements in ORM. It provides persistent support to NoSQL databases; today, NoSQL databases are used to handle large databases. This version best fits with the Maven repository to handle Hibernate 5 library.
Features of Hibernate 5:
- Bootstrap: This bootstrap comes with hibernate ORM.in; this new bootstrap mechanism of hibernate SessionFactory has been introduced with many advanced features.
- Modularity: This version supports Wildfly and OSGi; hence it helps in installing, activating, deactivating, and uninstalling during runtime.
- Added new Java 8 Date and Time API features, i.e., DATE, TIME, and TIMESTAMP.
- Bytecode Augmentation: This includes smarter change detection, bidirectional database relationship Management, and Enhanced dirty object checking.
- Attribute Converter: With added naming strategy physical and implicit, Enums without @Enumerated, Invoked on null values, @ElementCollection, @MayKey, @GeneratedValues, etc.
- OGM: Object /Grid Mapping- is one of the major features added with Hibernate 5, OGM helps to persist to NoSQL database. This helps to interact with NoSQL databases such as MongoDB, Cassandra, Redis, etc.
- Hibernate Search: Hibernate 5 comes with a full-text search by using Lucene 5.
5. Hibernate 5.3
Hibernate 5.3 is an upgraded version of 5.2 ORM. It comes with Hibernate Search 5.9. This version supports Java 8, the latest versions, and JPA 2.1 and the latest versions. Hibernate Search provides the functionality of a full-text search.
Features of Hibernate 5.3:
- It supports compatibility with hibernate ORM 5.2.
- In this version, the developers fixed bugs related to native query pagination and projection.
- This is an upgraded version of Hibernate ORM 5.2 and Hibernate Search 5.9.
- Compatible with Java 8 and the latest version, JPA 2.1 and Hibernate ORM 5.2, Hibernate search 5.9.
- Hibernate OGM is also compatible with this version.
- Improved Infinispan clustered counters which are used for sequence generation in hibernate, and this has been created during application start-up.
- While using infinispan it takes a table name and column name.
6. Hibernate 5.4.0
They released this version in 2019 and added two important features compared to the previous version.
Features of Hibernate 5.4.0:
- This version is compatible with Java 8 and Java 11 and with JPA 2.2.
- Added new features of EntityGraph parsing functionality. This is the ability to create a graph with String representation.
- EntityGraph Manipulation, this functionality is mainly used for combining graphs.
- Enhancement in bug fixes and Gradle Plugin.
- Performance concerning JDK 13.
Conclusion
While working with large applications with database connectivity, we use some database connectivity APIs, some of which are database-specific or platform-specific. We use a hibernate framework to overcome these drawbacks because the hibernate code is not database-specific. With a basic knowledge of SQL, the programmer can write a Hibernate code. Using a Hibernate framework increases the overall performance of data manipulation.
Recommended Articles
This is a guide to Hibernate Versions. Here we discuss the introduction and top 6 hibernate versions along with their features in detail. You may also look at the following articles to learn more –