Advantages of Hibernate


What is Hibernate ?
Hibernate is an open source, lightweight and Java based ORM software to develop
object based Database software independent O-R mapping persistence logic in Java, Jee based applications like Desktop,Web application,Enterprise application.

How to download Hibernate ?
Click here to download Hibernate Software (any version). For this tutorial we are using hibernate 3.2.6. So you can download hibernate3.2.6.ga.zip file and extract it.

Why should we use Hibernate ?
Hibernate is a framework software that is developed based on JDBC having the ability to generate common code of persistence logic dynamically.
Suppose we use JDBC for inserting the records into Database, then we have to follow bellow steps
  1. Register the JDBC driver with DriverManager .
  2. Establish the connection with Database Software.
  3.  Crate JDBC Statement object.
  4. Send and execute INSERT SQL query in database Software.
  5. Process the result
  6. Close JDBC object.
Like the above if we want to UPDATE the JDBC  code we have to follow bellow steps.
  1. Register the JDBC driver with DriverManager .
  2. Establish the connection with Database Software.
  3. Crate JDBC Statement object.
  4. Send and execute UPDATE SQL query in database Software.
  5. Process the result
  6. Close JDBC object.
In this approach only 4th and 5th steps are application specific logics and others are common logics. While working with core technologies like JDBC directly we need to concentrate develop both common logics and application specific logics.
If we work with framework software like Hibernate most of the common  specific logics are developed by Hibernate, so we need to develop only on application specific logics.
Hibernate provides abstraction layer on JDBC. so while developing Hibernate code we never bothered about internally generated JDBC code.

 Advantages of Hibernate
  1. Allow POJO or POJI model programming.
  2. Allow to develop OR mapping style Database  software independent persistence logic.
  3. gives HQL to develop Database software independent queries.
  4. Gives built in middle-ware services like Transaction management, Caching.
  5. Allows to work with third party supplied middle ware services and  Web Server and Application Server managed middle ware services.
  6. it is light weight software to develop OR  mapping persistence logic.
  7. Allows to develop objects based relationships like one-to-one,one-to-many,many-to-one,many-to-many.
  8. Gives support for annotation as alternate for XML.

No comments:

Post a Comment