If I have a service class that extends JpaRepository which extends CrudRepository and I am doing the CRUD just as fine in my service class, do I need to use EntityManager? Is there any advantage in using EntityManager over JpaRepository.
If you use the JPA repository you get some useful built-in CRUD methods and don't need to worry about EntityManager.
The only rare case where I sometimes have to use EntityManager is when I am writing unit tests for repository code.
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