I was confident that Spring Data
and Spring Data JPA
refers as same, but then I watched a tutorial on youtube about Spring Data and he is using JdbcTemplate
in that tutorial. So I got confused there.
I want to clarify that what is difference between Spring Data
and JdbcTemplate
? JdbcTemplate
and Spring Data JPA
are parts of Spring Data
?
JdbcTemplate
is part of the Spring Framework itself.
Spring Data is the project which consists of multiple sub-projects where Spring Data JPA is one of those sub-projects. Spring Data and the sub projects build on top of the Spring Framework.
Use Spring JdbcTemplate
if you don't want to access your database schema via a domain model. Using JPA you need to make sure that database schema maps correctly to the domain model.
Performance is almost similar at both spring JdbcTemplate
and JPA.
JPA is the Java Persistence API, which is Java's standard API for object-relational mapping.
The Spring Framework consists of a collection of projects, and one of these projects is Spring Data.
The goal of Spring Data is to make it easier to work with different kinds of databases, from traditional relational databases to NoSQL databases. Spring Data supports JPA via the Spring Data JPA subproject.
Here is one of my experienced colleague's recommendation:
To determine which technology to use, this is the order he prefers:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With