Engineering Full Stack Apps with Java and JavaScript
Hibernate is a framework that help you easily map Java classes to database tables (and Java fields to DB columns, Java data types to DB data types etc.), without writing the usual create, select, update and delete sql queries.
Hibernate is an ORM framework. Hibernate help you map your object model to a relational model.
In object model, objects are the main components of the system, and they are related to other classes via inheritance relationships. An object has an identity through its state, and behaviour.
A relational model defines the structure of data. In relational model, data is organized in the form of tables, and different tables are associated by means of referential integrity constraints.
Compared to traditional techniques of exchange between an object-oriented language and a relational database, ORM often reduces the amount of code that needs to be written.
The Java Persistence API (JPA) is a Java application programming interface specification that describes the management of relational data, especially persistance.
Hibernate also implements Java Persistence API.
By using JPA, it makes possible for us to change hibernate with any other framework that implements JPA easily in future with minimal changes.
The mappings between java classes and SQL constructs can be configured in xml files or using annotations.
Hibernate generates the required SQL calls and also attempts to relieve the developer from manual result set handling and object conversion.
Hibernate also keep the application portable to all supported SQL databases.
Hibernate also provides explicit data query and retrieval facilities, if needed.
Hibernate also has othe components like Hibernate Search, Hibernate Validator, and Hibernate OGM1 (No SQL).