Hibernate Tutorials : Introduction to hibernate

introduction to hibernate

Introduction to Hibernate

Introduction to hibernate will help you to understand what is ORM / Hibernate. Working in rapid application development with Object Oriented and Relational Database is very time consuming and sometimes it becomes difficult to manage relation between Objects and relational databases. And sometimes development costs become higher due to maintenance. Hibernate is an ORM (Object relational Mapping) tool which is free to download and use under GNU and LGPL license. Hibernate is an solution which provides us great control over Objects and Relational database. introduction to hibernate

What is ORM

ORM (Object Relational Mapping) is a technique in which object model (Normally Java POJO classes) is mapped to relational data model (which is database tables) and visa vera. Hibernate is not just mapping the Objects to Relational Database and visa versa but It also providing you the facilities to query data and different ways to retrieve. Which reduces the development time and maintenance because it reduces the effort for handling JDBC and SQL related work.

Advantages of using Hibernate

  1. Allows you to map plain Java Object to relational database and visa vera.
  2. Provides you great identifier generators.
  3. Support first level and second level cache to increase response rate.
  4. Hibernate is not vender spadicifc, you can use any database like MySql, Oracle, SQL server etc.
  5. Once you map Objects with Relational Database, you will have advantages of OOps concepts like Inheritance, encapsulation etc.
  6. Lazy loading, In case of parent class have multiple child objects. You can control to load child objects or not if you don’t need them.
  7. Comes up with it’s own query language HQL which is not depend on any vender. So if you switch to different database then you don’t need to change your query langauge.
  8. Hibernate supports relational mapping like One-To-Many, One-To-One, Many-To-Many, Many-To-One.
  9. Hibernate also supports different types of collections like List,Set,Map.
  10. In Hibernate, you don’t need to handle exceptions manually. Framework takes care of them because in Hibernate we only have Un-checked exceptions.
  11. Hibernate supports XML as well as annotation based configuration.

Leave a Reply

Your email address will not be published. Required fields are marked *