Hibernate is Framework, which is written in Java. It allows object-relational mapping (ORM). It can simplify the data retention of objects after finishing the data’s run. It is one of the Java Persistence API (JPA) implementation. The original creator of Hibernate is Gavin King, who then with his Hibernate went to the JBoss company. In 2006, the JBoss company was taken over by Red Hat company, which continued with the framework’s development.
Hibernate is Framework, which is written in Java. It allows object-relational mapping (ORM). It can simplify the data retention of objects after finishing the data’s run. It is one of the Java Persistence API (JPA) implementation. The original creator of Hibernate is Gavin King, who then with his Hibernate went to the JBoss company. In 2006, the JBoss company was taken over by Red Hat company, which continued with the framework’s development.
Hibernate provides way, which allows retention of the objects’ state between two application executions. It maintains persistent data. It allows ORM, i. e. mapping Java objects to entities stored in relational databases. During this process, it uses mapping files, which describe how should the data from given object transform into database and vice versa and how should the object creation from database tables happen.
Alternative way how is possible to map objects, is usage of annotation instead of mapping files. In Hibernate is worked with usual business objects, then the table’s columns can be connected directly to attributes of these objects or there can be connection through get/set methods and hashCode() or equals() methods.
There is a need to remind that there is not possible to use EJB, but exclusively classical objects, i. e. POJO (Plain Old Java Object). Then, once are the objects stored in database, they can be inquired about usage of HQL (Hibernate Query Language) language. It is derived from SQL and it is also very similar to it.
Hibernate can use mapping with the help of mapping files or annotations: