History
- relational databases are designed with Tables/Relations
- Java objects are designed using Object-Oriented Programming (OOP)
to store the data from objects into tables and vice-versa, methods:
- Earlier approaches involved writing SQL Queries:
- plain JDBC
- to cut down boilerplate code: JOOQ, Spring JdbcTemplate, QueryDSL, and MyBatis were popular approaches
- JPA evolved as a result of a different thought process: How about mapping tables/relationships directly to objects?
- this Mapping is also called Object Relational Mapping (ORM). Before JPA, ORM was the term more commonly used to refer to these frameworks. That’s one of the reasons, Hibernate is called an ORM framework
- Spring Data Repository - abstracts it even further
Terminology
- Java Database Connectivity (JDBC) - a Java API for connecting and executing queries against a Database
- Object Relational Mapping/Mapper (ORM) - the idea of mapping a table directly to an object (i.e. Java Data Object (JDO))
- Object Graph Mapping/Mapper (OGM) - the idea of mapping graphs (nodes and edges) to objects (i.e. Java Data Object (JDO))
- Java Persistence API (JPA) - is an ORM specification
- Hibernate - is an implementation of JPA
- Spring Data JPA - is a Spring Data Module that wraps Hibernate. allows you to make queries without writing SQL via Spring Data Repositories
- Spring Data contains other features for connecting to various databases