Introduction¶
Hibernate is a framework that implements the JPA
standard. Like the JDBC API
, it allows communication with the database at the level of a Java application, but relieves the developer from using JDBC
directly and, in some cases, frees the developer of the obligation to write SQL queries as well. It does this with an extra layer of abstraction.
In addition, Hibernate uses the ORM
(Object-relational mapping) technique, which allows you to represent a database table with a Java object.
Architecture¶
To put it simply, Hibernate covers the database handling with the Persistance Object
layer, which consists of many components and modules. This part connects to the data source using, i.a., JDBC API.
In order to use Hibernate in the project, we add:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.18.Final</version> <!-- A newer version can be available -->
</dependency>