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 f14bca46f..f5f61da67 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 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 @@ * @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 db41820f9..d805a6c8a 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 @@ 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 @@ * @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 ce7b16662..b7357ed41 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 6831968bd..9897bc843 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 @@ * @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 55acd182b..c50e552e5 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 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 reactor.core.publisher.Flux; - -import org.springframework.data.repository.reactive.ReactiveSortingRepository; import org.springframework.stereotype.Repository; -import java.util.List; - /** * @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 41a6d4a8f..04923bf04 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 @@ 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 b4ba58b48..722d7b505 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 @@ * @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 551aad1a9..ae8c5ed47 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 @@ 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 @@ * @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 2f9894c14..6eace6fe8 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 @@ 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 @@ * @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 46b370e98..ac47d11f1 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 @@ 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 @@ * @author Michael Reiche */ @Repository -public interface UserSubmissionUnannotatedRepository - extends PagingAndSortingRepository { +public interface UserSubmissionUnannotatedRepository extends CouchbaseRepository { @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) List findByUsername(String username);