Skip to content

Accomodate changes to springframework repository interfaces. #1347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -34,7 +35,7 @@
* @author Michael Reiche
*/
@NoRepositoryBean
public interface CouchbaseRepository<T, ID> extends PagingAndSortingRepository<T, ID> {
public interface CouchbaseRepository<T, ID> extends PagingAndSortingRepository<T, ID>, CrudRepository<T, ID> {

@Override
List<T> findAll(Sort sort);
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;

/**
Expand All @@ -28,7 +29,8 @@
* @since 3.0
*/
@NoRepositoryBean
public interface ReactiveCouchbaseRepository<T, ID> extends ReactiveSortingRepository<T, ID> {
public interface ReactiveCouchbaseRepository<T, ID>
extends ReactiveSortingRepository<T, ID>, ReactiveCrudRepository<T, ID> {
ReactiveCouchbaseOperations getOperations();

CouchbaseEntityInformation<T, String> getEntityInformation();
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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<Airline, String> {
public interface AirlineRepository extends CouchbaseRepository<Airline, String> {

@Query("#{#n1ql.selectEntity} where #{#n1ql.filter} and (name = $1)")
List<User> getByName(@Param("airline_name")String airlineName);
List<User> getByName(@Param("airline_name") String airlineName);

}
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;

/**
Expand All @@ -25,6 +25,6 @@
* @author Andrea Torlaschi
*/
@Repository
public interface LibraryRepository extends PagingAndSortingRepository<Library, String> {
public interface LibraryRepository extends CouchbaseRepository<Library, String> {

}
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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<Airline, String> {
public interface ReactiveAirlineRepository extends ReactiveCouchbaseRepository<Airline, String> {

@Query("#{#n1ql.selectEntity} where #{#n1ql.filter} and (name = $1)")
List<User> getByName(@Param("airline_name")String airlineName);
List<User> getByName(@Param("airline_name") String airlineName);

}
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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<User, String> {
public interface ReactiveUserRepository extends ReactiveCouchbaseRepository<User, String> {

Flux<User> findByFirstname(String firstname);

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;

/**
Expand All @@ -25,5 +25,4 @@
* @author Michael Reiche
*/
@Repository
public interface SubscriptionTokenRepository extends PagingAndSortingRepository<SubscriptionToken, String> {
}
public interface SubscriptionTokenRepository extends CouchbaseRepository<SubscriptionToken, String> {}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,8 +30,8 @@
* @author Michael Reiche
*/
@Repository
public interface UserSubmissionAnnotatedRepository extends PagingAndSortingRepository<UserSubmissionAnnotated, String> {
public interface UserSubmissionAnnotatedRepository extends CouchbaseRepository<UserSubmissionAnnotated, String> {

@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
List<UserSubmissionAnnotated> findByUsername(String username);
@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
List<UserSubmissionAnnotated> findByUsername(String username);
}
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -30,7 +30,7 @@
* @author Michael Reiche
*/
@Repository
public interface UserSubmissionRepository extends PagingAndSortingRepository<UserSubmission, String> {
public interface UserSubmissionRepository extends CouchbaseRepository<UserSubmission, String> {

@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
List<UserSubmission> findByUsername(String username);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,8 +30,7 @@
* @author Michael Reiche
*/
@Repository
public interface UserSubmissionUnannotatedRepository
extends PagingAndSortingRepository<UserSubmissionUnannotated, String> {
public interface UserSubmissionUnannotatedRepository extends CouchbaseRepository<UserSubmissionUnannotated, String> {

@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
List<UserSubmissionUnannotated> findByUsername(String username);
Expand Down