The main function of Hibernate is mapping Java classes to relational database. In addition, Hibernate also allows users to perform queries to the database through objects or normal SQL.
Hibernate has many different versions and the latest version is 3.x. In this version, Hibernate supports newer features such as Interceptor / Callback, user data can be defined and Anotation supported of Java5. Hibernate 3 is very similar to EJB3.0.
Mapping object and relations to database
To map to corresponding object by the table in the database, hibernate use xml file to describe how to use mapping or use anotation of Java to map objects directly. It supports types of relationship such as one-to-many, many-to-many between Java classes. In addition, it can manage combined relationships, inheritance between objects. It also allows users to define data types for their own archives, and also supports many other mappings such as: enum, collection, mapping for many different tables.
Persistence
Hibernate provides the ability to perform mapping Java classes (POJOs) into a database transparently. It only requires Java function do not have parameter and its properties are not public. In some special cases, it will require rewriting two functions: Equals and hashCode. Hibernate supports the data access rate by group (Collection), set, list… very good
Object query language
Hibernate allows users to perform queries on the subject without having to rewrite the SQL statement. It also provides a set of Criteria Queries that supports query implementation by the way of object-oriented programmer.
Compatibility
Since Hibernate was born, it has launched a major change for those database oriented programmers. Now itsupported in almost all the major frameworks such as Spring, Struts, JSF, tabestry, webwork… It not only supports Java developers but also supports.Net developer (Nhibernate)
Integration
Hibernate can run on almost different environment from single application (stand alone) to commercial Java applications that use servlet container, application server, EJB container.