Subscribe

Subscribe today and receive our blog updates in your Inbox.

×

Hibernate

Hibernate

hibernateHibernate ORM (Hibernate for short) is an object-relational mapping framework for the Java language. It provides a framework for mapping an object-oriented domain model to a relational database. Hibernate solves object-relational impedance mismatch problems by replacing direct, persistent database accesses with high-level object handling functions. Hibernate is free software that is distributed under the GNU Lesser General Public License 2.1.

Persistent data can be seen anywhere in an application. Managing persistent data is one of the few challenges that modern technologies/products are facing. Hibernate’s primary feature is mapping from Java classes to database tables; and mapping from Java data types to SQL data types. Hibernate also provides data query and retrieval facilities. It generates SQL calls and relieves the developer from manual handling and object conversion of the result set. Applications using Hibernate are portable to supported SQL databases.

Though Hibernate Framework is not the only persistence solution, it has become very famous over the recent past because of its huge variety of features when compared with its competitors. It takes much of the database related boiler-plate code from the developers, thereby asking the developers to concentrate on the core business logic of the application and not with the error-prone SQL syntax.

Most of the Hibernate features look very similar that are found in Java Persistence API (JPA) specification. Also Hibernate provides some add-on functionalities that are not mentioned in the JPA specification. Hibernate doesn’t replace JDBC. Hibernate is sitting on top of JDBC to connect to the database. Internally Hibernate is using these JDBC calls to connect to the database systems.
Hibernate is neither forcing its developers to use some specific interfaces for the classes to be persisted in an application nor it requires the program to follow some standard design to achieve its goals. For this reason, Hibernate can well integrate with all kinds any of J2SE/J2EE application and with any kind of frameworks (like Spring, Struts etc).

Hibernate Modules

  • The open-source Hibernate project has various different modules each representing a unique functionality.
  • Hibernate Core which represent the basic and the core module of the Hibernate project provides support for OO features along with the Query services.
  • Another module called Java Persistence with Hibernate is an implementation for the specification “Java Persistence API (JPA)” from Sun and we can be used in any Sun’s compliant Application Server as well as with J2SE applications.
  • There is a separate module called Hibernate Search that provides rich functionality for searching the persistence domain model using a simplified API.
  • For validating the data, Hibernate comes with a set of validation rules in the form of Annotations in a module called Hibernate validations and it also allows the developers to create custom validation rules.
  • Support for Querying and inserting data from multiple databases can be achieved by using the Hibernate Shards API.

More Info

Back