0

When we use JPA API in a String Boot project by extending repository class with JpaRepository and use MySQL database instead of hibernate's H2 database, I wanted to know is there hibernate still involved behind the scenes or, is it that JPA works with MySQL?

From what I have researched, Hibernate is implementation of JPA but I can't find any reference how MySQL works with JPA?

user963241
  • 6,758
  • 19
  • 65
  • 93
  • I thought it was the other way around: JPA is built on top of Hibernate. Basically, Java will communicate with MySQL via a JDBC driver. – Tim Biegeleisen Dec 30 '22 at 04:53
  • Yes, it seems "Spring Data JPA" is built on top of Hibernate, but JPA is implemented by hibernate. Yes, I had to include JDBC driver dependency as well. So, in this case hibernate isn't involved in the picture at all if I use MySQL? I am not able to grasp this because I am unclear about Hibernate's involvement. – user963241 Dec 30 '22 at 05:03
  • It is more like JPA is a implemenation of Hibernate. Hibernate sits in between JPA (at your Java application layer) and the JDBC driver (which sits in between the app and MySQL). – Tim Biegeleisen Dec 30 '22 at 05:05
  • I see. Any way I can monitor the application to see where the API calls are coming and going to in order see all this action? Thanks. It will make it easy to understand. – user963241 Dec 30 '22 at 05:10
  • Read [Enable Hibernate Logging](https://stackoverflow.com/questions/8490617/enable-hibernate-logging) here. – Tim Biegeleisen Dec 30 '22 at 05:11

0 Answers0