diff --git a/src/main/java/org/springframework/data/couchbase/repository/CouchbaseRepository.java b/src/main/java/org/springframework/data/couchbase/repository/CouchbaseRepository.java index f14bca46..f5f61da6 100644 --- a/src/main/java/org/springframework/data/couchbase/repository/CouchbaseRepository.java +++ b/src/main/java/org/springframework/data/couchbase/repository/CouchbaseRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2021 the original author or authors. + * Copyright 2013-2022 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. @@ -21,6 +21,7 @@ import java.util.List; import org.springframework.data.couchbase.core.CouchbaseOperations; import org.springframework.data.couchbase.repository.query.CouchbaseEntityInformation; import org.springframework.data.domain.Sort; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.NoRepositoryBean; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.Repository; @@ -34,7 +35,7 @@ import com.couchbase.client.java.query.QueryScanConsistency; * @author Michael Reiche */ @NoRepositoryBean -public interface CouchbaseRepository extends PagingAndSortingRepository { +public interface CouchbaseRepository extends PagingAndSortingRepository, CrudRepository { @Override List findAll(Sort sort); diff --git a/src/main/java/org/springframework/data/couchbase/repository/ReactiveCouchbaseRepository.java b/src/main/java/org/springframework/data/couchbase/repository/ReactiveCouchbaseRepository.java index db41820f..d805a6c8 100644 --- a/src/main/java/org/springframework/data/couchbase/repository/ReactiveCouchbaseRepository.java +++ b/src/main/java/org/springframework/data/couchbase/repository/ReactiveCouchbaseRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2021 the original author or authors. + * Copyright 2017-2022 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. @@ -18,6 +18,7 @@ package org.springframework.data.couchbase.repository; import org.springframework.data.couchbase.core.ReactiveCouchbaseOperations; import org.springframework.data.couchbase.repository.query.CouchbaseEntityInformation; import org.springframework.data.repository.NoRepositoryBean; +import org.springframework.data.repository.reactive.ReactiveCrudRepository; import org.springframework.data.repository.reactive.ReactiveSortingRepository; /** @@ -28,7 +29,8 @@ import org.springframework.data.repository.reactive.ReactiveSortingRepository; * @since 3.0 */ @NoRepositoryBean -public interface ReactiveCouchbaseRepository extends ReactiveSortingRepository { +public interface ReactiveCouchbaseRepository + extends ReactiveSortingRepository, ReactiveCrudRepository { ReactiveCouchbaseOperations getOperations(); CouchbaseEntityInformation getEntityInformation(); diff --git a/src/test/java/org/springframework/data/couchbase/domain/AirlineRepository.java b/src/test/java/org/springframework/data/couchbase/domain/AirlineRepository.java index ce7b1666..b7357ed4 100644 --- a/src/test/java/org/springframework/data/couchbase/domain/AirlineRepository.java +++ b/src/test/java/org/springframework/data/couchbase/domain/AirlineRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2019 the original author or authors. + * Copyright 2017-2022 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. @@ -16,17 +16,17 @@ package org.springframework.data.couchbase.domain; +import java.util.List; + +import org.springframework.data.couchbase.repository.CouchbaseRepository; import org.springframework.data.couchbase.repository.Query; -import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; -import java.util.List; - @Repository -public interface AirlineRepository extends PagingAndSortingRepository { +public interface AirlineRepository extends CouchbaseRepository { @Query("#{#n1ql.selectEntity} where #{#n1ql.filter} and (name = $1)") - List getByName(@Param("airline_name")String airlineName); + List getByName(@Param("airline_name") String airlineName); } diff --git a/src/test/java/org/springframework/data/couchbase/domain/LibraryRepository.java b/src/test/java/org/springframework/data/couchbase/domain/LibraryRepository.java index 6831968b..9897bc84 100644 --- a/src/test/java/org/springframework/data/couchbase/domain/LibraryRepository.java +++ b/src/test/java/org/springframework/data/couchbase/domain/LibraryRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors + * Copyright 2012-2022 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. @@ -16,7 +16,7 @@ package org.springframework.data.couchbase.domain; -import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.couchbase.repository.CouchbaseRepository; import org.springframework.stereotype.Repository; /** @@ -25,6 +25,6 @@ import org.springframework.stereotype.Repository; * @author Andrea Torlaschi */ @Repository -public interface LibraryRepository extends PagingAndSortingRepository { +public interface LibraryRepository extends CouchbaseRepository { } diff --git a/src/test/java/org/springframework/data/couchbase/domain/ReactiveAirlineRepository.java b/src/test/java/org/springframework/data/couchbase/domain/ReactiveAirlineRepository.java index 55acd182..c50e552e 100644 --- a/src/test/java/org/springframework/data/couchbase/domain/ReactiveAirlineRepository.java +++ b/src/test/java/org/springframework/data/couchbase/domain/ReactiveAirlineRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors + * Copyright 2012-2022 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. @@ -16,22 +16,20 @@ package org.springframework.data.couchbase.domain; -import org.springframework.data.couchbase.repository.Query; -import org.springframework.data.repository.query.Param; -import reactor.core.publisher.Flux; - -import org.springframework.data.repository.reactive.ReactiveSortingRepository; -import org.springframework.stereotype.Repository; - import java.util.List; +import org.springframework.data.couchbase.repository.Query; +import org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + /** * @author Michael Reiche */ @Repository -public interface ReactiveAirlineRepository extends ReactiveSortingRepository { +public interface ReactiveAirlineRepository extends ReactiveCouchbaseRepository { @Query("#{#n1ql.selectEntity} where #{#n1ql.filter} and (name = $1)") - List getByName(@Param("airline_name")String airlineName); + List getByName(@Param("airline_name") String airlineName); } diff --git a/src/test/java/org/springframework/data/couchbase/domain/ReactiveUserRepository.java b/src/test/java/org/springframework/data/couchbase/domain/ReactiveUserRepository.java index 41a6d4a8..04923bf0 100644 --- a/src/test/java/org/springframework/data/couchbase/domain/ReactiveUserRepository.java +++ b/src/test/java/org/springframework/data/couchbase/domain/ReactiveUserRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors + * Copyright 2012-2022 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. @@ -18,11 +18,11 @@ package org.springframework.data.couchbase.domain; import reactor.core.publisher.Flux; -import org.springframework.data.repository.reactive.ReactiveSortingRepository; +import org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository; import org.springframework.stereotype.Repository; @Repository -public interface ReactiveUserRepository extends ReactiveSortingRepository { +public interface ReactiveUserRepository extends ReactiveCouchbaseRepository { Flux findByFirstname(String firstname); diff --git a/src/test/java/org/springframework/data/couchbase/domain/SubscriptionTokenRepository.java b/src/test/java/org/springframework/data/couchbase/domain/SubscriptionTokenRepository.java index b4ba58b4..722d7b50 100644 --- a/src/test/java/org/springframework/data/couchbase/domain/SubscriptionTokenRepository.java +++ b/src/test/java/org/springframework/data/couchbase/domain/SubscriptionTokenRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 the original author or authors + * Copyright 2020-2022 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. @@ -16,7 +16,7 @@ package org.springframework.data.couchbase.domain; -import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.couchbase.repository.CouchbaseRepository; import org.springframework.stereotype.Repository; /** @@ -25,5 +25,4 @@ import org.springframework.stereotype.Repository; * @author Michael Reiche */ @Repository -public interface SubscriptionTokenRepository extends PagingAndSortingRepository { -} +public interface SubscriptionTokenRepository extends CouchbaseRepository {} diff --git a/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionAnnotatedRepository.java b/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionAnnotatedRepository.java index 551aad1a..ae8c5ed4 100644 --- a/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionAnnotatedRepository.java +++ b/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionAnnotatedRepository.java @@ -18,8 +18,8 @@ package org.springframework.data.couchbase.domain; import java.util.List; +import org.springframework.data.couchbase.repository.CouchbaseRepository; import org.springframework.data.couchbase.repository.ScanConsistency; -import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import com.couchbase.client.java.query.QueryScanConsistency; @@ -30,8 +30,8 @@ import com.couchbase.client.java.query.QueryScanConsistency; * @author Michael Reiche */ @Repository -public interface UserSubmissionAnnotatedRepository extends PagingAndSortingRepository { +public interface UserSubmissionAnnotatedRepository extends CouchbaseRepository { - @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) - List findByUsername(String username); + @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) + List findByUsername(String username); } diff --git a/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionRepository.java b/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionRepository.java index 2f9894c1..6eace6fe 100644 --- a/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionRepository.java +++ b/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2021 the original author or authors + * Copyright 2020-2022 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. @@ -18,8 +18,8 @@ package org.springframework.data.couchbase.domain; import java.util.List; +import org.springframework.data.couchbase.repository.CouchbaseRepository; import org.springframework.data.couchbase.repository.ScanConsistency; -import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import com.couchbase.client.java.query.QueryScanConsistency; @@ -30,7 +30,7 @@ import com.couchbase.client.java.query.QueryScanConsistency; * @author Michael Reiche */ @Repository -public interface UserSubmissionRepository extends PagingAndSortingRepository { +public interface UserSubmissionRepository extends CouchbaseRepository { @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) List findByUsername(String username); diff --git a/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionUnannotatedRepository.java b/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionUnannotatedRepository.java index 46b370e9..ac47d11f 100644 --- a/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionUnannotatedRepository.java +++ b/src/test/java/org/springframework/data/couchbase/domain/UserSubmissionUnannotatedRepository.java @@ -18,8 +18,8 @@ package org.springframework.data.couchbase.domain; import java.util.List; +import org.springframework.data.couchbase.repository.CouchbaseRepository; import org.springframework.data.couchbase.repository.ScanConsistency; -import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import com.couchbase.client.java.query.QueryScanConsistency; @@ -30,8 +30,7 @@ import com.couchbase.client.java.query.QueryScanConsistency; * @author Michael Reiche */ @Repository -public interface UserSubmissionUnannotatedRepository - extends PagingAndSortingRepository { +public interface UserSubmissionUnannotatedRepository extends CouchbaseRepository { @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) List findByUsername(String username);