1

I know that spring data rest will export your repositories as REST services..but i want to know advantages of that over use of spring data jpa.

Oliver Drotbohm
  • 80,157
  • 18
  • 225
  • 211
MasterCode
  • 975
  • 5
  • 21
  • 44

2 Answers2

9

This is a fruit-salad-to-buffet comparison as the technologies solve completely different problems:

Spring Data JPA eases working with JPA on top of Spring. It exposes a repository programming model which allows you to build Java APIs to access data in relational databases.

Spring Data REST builds on top of the repository abstraction (not being tied to JPA at all) and exposes Spring MVC based REST resources following common patterns via a HTTP.

I suggest to skim through the getting started guides for Spring Data JPA and Spring Data REST to play with both of them and get a feel for the problems they solve.

Oliver Drotbohm
  • 80,157
  • 18
  • 225
  • 211
6

Spring-Data-JPA is just one "flavour" of how you will persist your data. Among others, there are also MongoDB, Neo4J, etc. So as Oliver explained, Spring-Data is about how and where you keep your data.

On the other hand, Spring-Data REST is implementation, how to expose that data through REST using best practices.

Hope this clarifies a bit.

staleksit
  • 67
  • 4