DATAMONGO-1706 - Adapt to deprecated RxJava 1 CRUD repositories.
Move off RxJava1CrudRepository as base repository in tests by extending just Repository and declaring query methods/overloads using RxJava1 types.
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.mongodb.repository.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -34,7 +33,7 @@ import org.springframework.util.Assert;
|
||||
* @author Christoph Strobl
|
||||
* @since 2.0
|
||||
* @see org.springframework.data.repository.reactive.ReactiveSortingRepository
|
||||
* @see org.springframework.data.repository.reactive.RxJava1SortingRepository
|
||||
* @see org.springframework.data.repository.reactive.RxJava2SortingRepository
|
||||
*/
|
||||
public class ReactiveMongoRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable>
|
||||
extends RepositoryFactoryBeanSupport<T, S, ID> {
|
||||
|
||||
@@ -44,7 +44,6 @@ import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.repository.config.EnableReactiveMongoRepositories;
|
||||
import org.springframework.data.repository.reactive.ReactiveSortingRepository;
|
||||
import org.springframework.data.repository.reactive.RxJava1SortingRepository;
|
||||
import org.springframework.data.repository.reactive.RxJava2SortingRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
@@ -286,13 +285,17 @@ public class ConvertingReactiveMongoRepositoryTests {
|
||||
}
|
||||
|
||||
@Repository
|
||||
interface RxJava1PersonRepostitory extends RxJava1SortingRepository<ReactivePerson, String> {
|
||||
interface RxJava1PersonRepostitory extends org.springframework.data.repository.Repository<ReactivePerson, String> {
|
||||
|
||||
Observable<ReactivePerson> findByFirstnameAndLastname(String firstname, String lastname);
|
||||
|
||||
Single<ReactivePerson> findByLastname(String lastname);
|
||||
|
||||
Single<ProjectedPerson> findProjectedByLastname(String lastname);
|
||||
|
||||
Single<Boolean> existsById(String id);
|
||||
|
||||
Single<Boolean> existsById(Single<String> id);
|
||||
}
|
||||
|
||||
@Repository
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.mongodb.repository.config;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
@@ -34,7 +33,7 @@ import org.springframework.data.repository.config.AnnotationRepositoryConfigurat
|
||||
import org.springframework.data.repository.config.RepositoryConfiguration;
|
||||
import org.springframework.data.repository.config.RepositoryConfigurationSource;
|
||||
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
|
||||
import org.springframework.data.repository.reactive.RxJava1CrudRepository;
|
||||
import org.springframework.data.repository.reactive.RxJava2CrudRepository;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link ReactiveMongoRepositoryConfigurationExtension}.
|
||||
@@ -108,7 +107,7 @@ public class ReactiveMongoRepositoryConfigurationExtensionUnitTests {
|
||||
|
||||
interface SampleRepository extends ReactiveCrudRepository<Sample, Long> {}
|
||||
|
||||
interface UnannotatedRepository extends RxJava1CrudRepository<Store, Long> {}
|
||||
interface UnannotatedRepository extends RxJava2CrudRepository<Store, Long> {}
|
||||
|
||||
interface StoreRepository extends ReactiveMongoRepository<Store, Long> {}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,16 +13,15 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.mongodb.repository.custom;
|
||||
|
||||
import org.springframework.data.mongodb.repository.User;
|
||||
import org.springframework.data.repository.reactive.RxJava1CrudRepository;
|
||||
import org.springframework.data.repository.reactive.RxJava2CrudRepository;
|
||||
|
||||
/**
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public interface CustomReactiveMongoRepository
|
||||
extends RxJava1CrudRepository<User, String>, CustomReactiveMongoRepositoryCustom {
|
||||
extends RxJava2CrudRepository<User, String>, CustomReactiveMongoRepositoryCustom {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user