What is the difference between JpaRepository and MongoRepository? - spring

I don't know the difference between JpaRepository and MongoRepository.

JPARepository and MongoRepository are technology-specific abstraction of the Spring Data Repositories.
If you are using RDBMS such as MySQL/PostgreSQL, you may use Spring Data Repositories such as JpaRepository.
If using a NoSQL such as Mongo, you will need the MongoReposiroty.

Related

About CrudRepository and Criteria API

I'm new to Spring Boot and now I'm learning to modify data with JPA and Hibernate. I wonder is there any way that I can combine Criteria API of Hibernate with Crud Repository, and add more methods into the repository.

Query relational database with Spring Data JPA and Hibernate

I am new to Spring and Hibernate. I have a project using Spring, Hibernate and PostgreSQL. I know that I can query the database using Spring Data JPA or Hibernate, but I don't know what the benefits and disadvantages of each approach. I also know that in the background, Spring Data JPA will call Hibernate. So what is the best way I should use to query the database to get the best performance, Spring Data JPA or Hibernate or depending on the specific usage situation. Thanks very much
I think it is based on the requirements of your project.
You can find more answers to this question at StackOverflow.

How to benefit the auditing infra of spring data mongo?

Unlike spring data jpa I could not find the #EntitListeners annotation in spring data mongo which I could use along with #Document annotation on models for auditing purpose.
Early guidance will be highly appreciated.
There are LifeCycle Events like in JPA also for MongoDB.
Have a look at the documentation:
https://docs.spring.io/spring-data/mongodb/docs/2.0.9.RELEASE/reference/html/#mongodb.mapping-usage.events

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
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.

Spring roo and jOOQ

jOOQ should be an alternative to standard JPA. Is there any way to use it in Roo as JPA provider? Is it even possible?
The reason for this: We have Oracle database and jOOQ has quick and easy set up for connection to that database. On the other hand, Roo is very usefull tool but lacks on setting up Oracle database connection.
jOOQ doesn't implement JPA. It just happens to support a few JPA annotations, which is far from actually implementing JPA. In other words, no you cannot use jOOQ as a JPA provider in Spring Roo

Resources