Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring data required hibernate or not

I have one doubt about implementation of spring data, have basic knowledge about spring data. I understand JPA and Hibernate, how it work. Hibernate provide the implementation for JPA. My questions, Can we work alone with Spring data to persist data in mysql or we need some provider like hibernate or toplink etc for midsize application

like image 257
Sandy Avatar asked Jan 08 '23 07:01

Sandy


1 Answers

The structure is as follows:

Spring Data JPA
       |
      JPA
       |
   Hibernate

You need Hibernate as an JPA implementation, but from your perspective you should only see Spring Data JPA.

When designing your entities if you make sure that you use only annotations from the javax.persistence package you will not depend on one concrete JPA implementation (in this case Hibernate) but theoretically you could swap Hibernate for EclipseLink or something else.

like image 190
Robert Niestroj Avatar answered Jan 15 '23 20:01

Robert Niestroj