Wednesday, 20 March 2013

Understanding Object-Relational Mapping

Object-Relational Mapping, or in short ORM is used to map data taken from a database to Objects.

For instance, you have a table PERSON in your database with the following values:






In your code, you need to get the Person object with id=2. So the expected output should be

{ 2, Jane, Fitzgerald, jfitzgerald@gmail.com }


So you create a query,

Select * from Person where id='2'. This is where hibernate, iBatis or other ORM.













The blue line is the job for iBatis, Hibernate and other ORM. Every ORM has a different way of mapping the data from the database to an object.



0 comments:

Post a Comment