Introduction to Hibernate Versions
Hibernate is the Object Relational Mapping framework that helps in mapping an object-oriented domain model to a relational database. The first version of hibernate was developed in 2001 Cirus Technologies by Gavin King with the aim of providing persistent capacity than those of EJB2. Later various hibernate versions were launched with adding extra features. Hibernate 2 was launched by adding extra features to the first version. Later 3.0 or 3 series launched with new features of interceptors, filters, and JPA specifications. Hibernate 4.0 and/or 4 series launched with features like multi-tenancy, advanced session management, and 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
It developed to support java 1.5 version with full-featured query facilities and enhanced EJB3 persistence.
Features of Hibernate 3:
- 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.
- Runtime performance monitoring is added with the help of JMX or Local java APIs.
- 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 version up to JDK 1.5.
2. Hibernate 4.0
Hibernate 4 was released in 2011 added with new features of multi-tenancy, service registry, SessionFactory clean-up, auto-discovery, full support of i18n, etc.
Features of Hibernate 4.0:
- Multi-tenancy support 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 different categories – Public, Internal and SPI.
- Verifying dirty objects i.e. allows the user to specify when an object should be considered as dirty.
- Full support of i18n this 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 and this version can be used with JDK 7 based applications. This version 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 execute CriteriaUpdate and CriteriaDelete.
- This version support for attribute converters.
- Dependency injection through Contexts of Dependency Injection.
- Added with Entity Graph Support.
- @ConstructorResult support added for the result set mapping using native queries.
- Support synchronization contexts through SynchronizationType.
- Supports standardized schema generation.
4. Hibernate 5
It is one of the major updates in hibernate 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 using 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 version new bootstrap mechanism of hibernate SessionFactory has introduced with many advanced features.
- Modularity: This version supports Wildfly and OSGi hence it helps in installing, activating, deactivating, uninstalling during runtime.
- Added new features of Java 8 Date and Time API i.e. DATE, TIME and TIMESTAMP.
- Bytecode Augmentation: This includes smarter change detection, bidirectional database relationship Management, 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- this is one of the major features added with Hibernate 5, OGM helps in the ability persistence 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 and 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 the compatibility with hibernate ORM 5.2.
- In this version bugs related to native query pagination and projection are fixed.
- 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
This version released in 2019. added two important features compared with the previous version.
- This version is compatible with Java 8 and Java 11 and with JPA 2.2.
- Added with new features of EntityGraph parsing functionality. This is the ability to creating a graph with String representation.
- EntityGraph Manipulation this functionality is mainly used for combining graphs.
- Enhancement in bug fixes and Gradle Plugin.
- Performance with respect to JDK 13.
While we are working with large applications with database connectivity we use some database connectivity APIs some of them are database-specific or platform-specific. To overcome these drawbacks we use a hibernate framework is used because the hibernate code is not database-specific. With a basic knowledge of SQL, the programmer can write a Hibernate code. The overall performance of data manipulation is increased by using a hibernate framework.
This is a guide to Hibernate Versions. Here we discuss the Introduction and top 6 Hibernate Versions along with its different features in detail. You may also look at the following articles to learn more –