Object-Relational Mapping Introduction

Introduction to ORM(Object-Relational Mapping) :

It is a programming technique for converting object-type data of an object oriented programming language into database tables. Hibernate is used convert object data in JAVA to relational database tables.Support CRUD (Create, Read, Update and Delete) operations. It provides RDBMS Vendor independence

Object Persistence

  • Saving objects for future use
  • Storage could be a File system, RDBMS etc
  • Today’s popular data storage systems are RDBMS
  • Objects are not directly mapped to RDBMS tables

Traditional Solutions

  • JDBC/SQL code embedded in Class, EJB (J2EE) solution etc
  • More coding, container dependent etc are the issues
  • Best practice would be to keep the Persistence separate from classes

ORM Solutions

  • Hibernate – Open Source
  • iBatis SQL Maps – Open Source
  • TopLink – Commercial
  • JPA – Java EE 5 Solution