liveBook · Manning

Object-relational mapper

As explained in Spring Start Here, Second Edition

An ORM framework provides software for mapping application objects to relational database records and relationships.

An object-relational mapper (ORM) lets an application treat relational database tables and their relationships as objects and relationships among objects. Hibernate is one example. section 1.4.4

An ORM can reduce code and make database operations more intuitive when used well. Misuse can slow an application, make code less intuitive, or introduce bugs. section 1.4.4

Choosing a persistence approach

A team maintaining an application with direct JDBC queries considered replacing them with Hibernate. After a proof of concept, it chose Spring's JdbcTemplate instead, aiming to clean up the code without adopting a new framework. section 1.4.4

Figure 14.3 Sometimes apps use frameworks built on top of JDBC, such as Hibernate. The variety in choices makes implementing a persistence layer complex. We want to eliminate this complexity from our apps, and, as you’ll learn, Spring Data helps us do this.

The diagram places Hibernate among frameworks built over JDBC, illustrating one way an application can implement its persistence layer. section 14.1

How Spring Start Here, Second Edition covers it

How deep it goes
Defines object-relational mapping and notes potential benefits and risks, but does not detail mapping mechanics or configuration.
Examples
Contrasts direct JDBC queries and a proposed Hibernate migration with a completed JdbcTemplate rewrite.
What you can do after
Evaluate whether an ORM fits a persistence change by weighing shorter, more intuitive code against performance and bug risks.
How it connects
Connects Hibernate with JDBC, relational databases, persistence layers, and Spring Data's broader technology abstraction.

Also explained in

Compare how 9 books explain object-relational mapper →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring Start Here, Second Edition. The section links point to the parts of the book it draws on.