1. 程式人生 > >SpringData,JPA,MongoDB,Solr,Elasticsearch底層邏輯關系

SpringData,JPA,MongoDB,Solr,Elasticsearch底層邏輯關系

sort and grep ria end sea gda osi -m

一: Spring-data底層的接口路基:

spring-data : PagingAndSortingRepository-> CrudRepository-> Repository ,它是springdatajpa,solr,mongoDB,Elasticsearch的核心基礎。

有三個主要的接口:

1. Repository<T, ID> {}空接口

2.CrudRepository<T, ID>extends Repository<T, ID> 主要是CRUD接口

3.PagingAndSortingRepository<T, ID>extends CrudRepository<T, ID>主要是分頁排序和CDUR的方法

二:關於 spring-data-jpa

spring-data-jpa:它只有一個核心的接口便 是JpaRepository,它的接口路基關系是:

JpaRepository<T, ID extends Serializable>extends PagingAndSortingRepository<T, ID>, QueryByExampleExecutor<T>CRUD分頁排序等方法都有

三:關於spring-data-solr,它的接口路基關系是:SolrRepository->Repository,它有二個核心基礎接口:

1.SolrRepository<T, ID extends Serializable>extends Repository<T, ID>
2.SolrCrudRepository-> SolrRepository<T, ID>, PagingAndSortingRepository

四:關於spring-data-mongoDB,它的接口路基是MongoRepository->PagingAndSortingRepository,它有一個核心接口是
1.MongoRepository<T, ID extends Serializable> extends PagingAndSortingRepository<T, ID>, QueryByExampleExecutor<T>

五:Spring-data-Elasticsearch:它的接口路基是ElasticsearchPagingAndSortingRepository-> ElasticsearchCrudRepository-> ElasticsearchRepository ,它 有二個核心基礎的接口是:

1.ElasticsearchRepository<T, ID extends Serializable>extends ElasticsearchCrudRepository<T, ID>
2.ElasticsearchCrudRepository<T, ID extends Serializable>extends PagingAndSortingRepository<T, ID>

SpringData,JPA,MongoDB,Solr,Elasticsearch底層邏輯關系