When an application is developed, a major portion of that application involves the creation and maintenance of the persistence layer to store and retrieve objects from the database. Whenever any changes are made to the underlying database schema, it can be expensive to spread those changes to the rest of the application. To overcome this problem, a new technology is used called Hibernate.

Hibernate is an open-source object-relational mapping tool (ORM) that lets you develop persistent classes and objects in a relationa database using following common Java idiom such as - association, inheritance, polymorphism, composition and the Java collections framework. It provides facilities for database connection pooling, data retrieval and update, transaction management, programmatic queries, as well as entity
relationship management. In addition, it allows transparent persistence that enables the applications to switch any database.

Hibernate is a better and an effective way to interact with a database. It provides an easyto- use and powerful object-relational persistence framework for Java applications. It can be used in Java Swing applications, Java Servlet-based applications, or J2EE applications using EJB session beans.

Hibernate also supports persisting objects for collections and object relations providing a rich data query language to retrieve objects from the database that significantly reduce the development time. It maps the Java classes to
the database tables. It is most useful with object-oriented domain modes and business logic in the Java-based middle-tier.

Features of Hibernate

Some of the main features of hibernate are listed below:


  • Hibernate works with classes and objects instead of queries and result sets. It reduces the development time as it supports inheritance, polymorphism, composition and the Java collection framework. So it is fully Object Oriented tool with less procedural.
  • Hibernate generates SQL expressions for Java. It relieves you from manual JDBC result set handling and object conversion, and keeps your application portable to all SQL databases.
  • It handles all create-read-updatedelete (CRUD) operations using simple API, and generates DDL scripts to create DB schema (tables, constraints,
  • Hibernate is Free under LGPL. It can be used to develop/package and distribute the applications for free.
  • Hibernate XML binding enables data to be represented as XML and POJOs interchangeably.
  • Hibernate offers full-featured query options, through which you can write plain SQL, object-oriented HQL (Hibernate Query Language), or create programatic Criteria and Example
  • It provides filters for working with temporal (historical), regional or authorized data as well as runtime performance monitoring via JMX or local Java API, including a second-level cache
  • Hibernate not only supports higher versions of JDK but also runs perfectly with JDK 1.2 supporting automatic generation of primary key.
  • Hibernate is released under the GNU Public License, which can be used in all open source and commercial applications without limitations. It supports for a wide range of databases, including Oracle and DB2, Sybase as well as
    popular open source databases such as PostgreSQL and MySQL.

Dec   2007 | Java Jazz Up |26
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 ,

Download PDF