Difference between ORM and Object Mapping?

banan3'14 :

On Spring Boot tutorial site I read the following:

Great thing about Spring Framework is that it does not try to solve problems which are already solved. All that it does is to provide a great integration with frameworks which provide great solutions.

  • Hibernate for ORM
  • iBatis for Object Mapping

That's how Hibernate explains its purpose:

Hibernate ORM enables developers to more easily write applications whose data outlives the application process. As an Object/Relational Mapping (ORM) framework, Hibernate is concerned with data persistence as it applies to relational databases (via JDBC).

Apart from the fact that iBatis changed the name to MyBatis, the solution MyBatis offers seems to be different from ORM approach. On their introduction page, MyBatis's creators write:

MyBatis is a first class persistence framework with support for custom SQL, stored procedures and advanced mappings. MyBatis eliminates almost all of the JDBC code and manual setting of parameters and retrieval of results. MyBatis can use simple XML or Annotations for configuration and map primitives, Map interfaces and Java POJOs (Plain Old Java Objects) to database records.

So my guess is that Object Mapping must be closer to the database, SQL, stored procedures and the like. I don't know if it can be applied to NoSQL databases. Whereas, ORM concerns only relational databases.

Is ORM really different from Object Mapping or are they synonyms? What is the difference?

pirho :

So my guess is that Object Mapping must be closer to the database, SQL, stored procedures and the like. I don't know if it can be applied to NoSQL databases. Whereas, ORM concerns only relational databases.

Yes, when it comes to difference between mybatis and hibernate. Here is a good explanation which clarifies this difference quite well in your case.

Is ORM really different from Object Mapping or are they synonyms? What is the difference?

About the term "object mapping": it can also mean some other things that necessarily not have any relation to databases or so. For example Jackson might use object mapper to map Json data to some java POJO.

I tend to speak (and hear) about ORM when it goes with @Entity & JPA implementations so quite high level / abstraction stuff.

Object mapping on the other hand - at least in Java- can mean anything that maps arbitrary data to object, object to another object or object to arbitrary data (like a row in a db table).

But not that I do not mean that term object mapping should be used that way, however this might also be interesting reading.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=71271&siteId=1