diff --git a/src/main/java/org/springframework/data/aerospike/repository/AerospikeRepository.java b/src/main/java/org/springframework/data/aerospike/repository/AerospikeRepository.java index 14c182ff8..879c147d8 100644 --- a/src/main/java/org/springframework/data/aerospike/repository/AerospikeRepository.java +++ b/src/main/java/org/springframework/data/aerospike/repository/AerospikeRepository.java @@ -17,7 +17,6 @@ import com.aerospike.client.query.IndexType; import org.springframework.data.aerospike.IndexAlreadyExistsException; -import org.springframework.data.repository.NoRepositoryBean; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.Repository; @@ -28,7 +27,6 @@ * @author Peter Milne * @author Jean Mercier */ -@NoRepositoryBean public interface AerospikeRepository extends PagingAndSortingRepository { void createIndex(Class domainType, String indexName, String binName, IndexType indexType); diff --git a/src/main/java/org/springframework/data/aerospike/repository/ReactiveAerospikeRepository.java b/src/main/java/org/springframework/data/aerospike/repository/ReactiveAerospikeRepository.java index d08b7d275..cfc4048b5 100644 --- a/src/main/java/org/springframework/data/aerospike/repository/ReactiveAerospikeRepository.java +++ b/src/main/java/org/springframework/data/aerospike/repository/ReactiveAerospikeRepository.java @@ -1,6 +1,5 @@ package org.springframework.data.aerospike.repository; -import org.springframework.data.repository.NoRepositoryBean; import org.springframework.data.repository.Repository; import org.springframework.data.repository.reactive.ReactiveCrudRepository; @@ -9,7 +8,6 @@ * * @author Igor Ermolenko */ -@NoRepositoryBean public interface ReactiveAerospikeRepository extends ReactiveCrudRepository { } diff --git a/src/main/java/org/springframework/data/aerospike/repository/config/AerospikeRepositoriesRegistrar.java b/src/main/java/org/springframework/data/aerospike/repository/config/AerospikeRepositoriesRegistrar.java index 25b7b7f19..6d83596b4 100644 --- a/src/main/java/org/springframework/data/aerospike/repository/config/AerospikeRepositoriesRegistrar.java +++ b/src/main/java/org/springframework/data/aerospike/repository/config/AerospikeRepositoriesRegistrar.java @@ -27,19 +27,11 @@ */ public class AerospikeRepositoriesRegistrar extends RepositoryBeanDefinitionRegistrarSupport { - /* - * (non-Javadoc) - * @see org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport#getAnnotation() - */ @Override protected Class getAnnotation() { return EnableAerospikeRepositories.class; } - /* - * (non-Javadoc) - * @see org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport#getExtension() - */ @Override protected RepositoryConfigurationExtension getExtension() { return new AerospikeRepositoryConfigurationExtension(); diff --git a/src/main/java/org/springframework/data/aerospike/repository/config/AerospikeRepositoryConfigurationExtension.java b/src/main/java/org/springframework/data/aerospike/repository/config/AerospikeRepositoryConfigurationExtension.java index 7eb3772c6..c567213ed 100644 --- a/src/main/java/org/springframework/data/aerospike/repository/config/AerospikeRepositoryConfigurationExtension.java +++ b/src/main/java/org/springframework/data/aerospike/repository/config/AerospikeRepositoryConfigurationExtension.java @@ -1,8 +1,15 @@ package org.springframework.data.aerospike.repository.config; +import org.springframework.data.aerospike.mapping.Document; +import org.springframework.data.aerospike.repository.AerospikeRepository; +import org.springframework.data.aerospike.repository.support.AerospikeRepositoryFactoryBean; import org.springframework.data.repository.config.RepositoryConfigurationExtension; import org.springframework.data.repository.core.RepositoryMetadata; +import java.lang.annotation.Annotation; +import java.util.Collection; +import java.util.Collections; + /** * {@link RepositoryConfigurationExtension} for Aerospike. * @@ -10,33 +17,36 @@ */ public class AerospikeRepositoryConfigurationExtension extends BaseAerospikeRepositoryConfigurationExtension { - /* - * (non-Javadoc) - * @see org.springframework.data.keyvalue.repository.config.KeyValueRepositoryConfigurationExtension#getModuleName() - */ @Override public String getModuleName() { return "Aerospike"; } - /* - * (non-Javadoc) - * @see org.springframework.data.keyvalue.repository.config.KeyValueRepositoryConfigurationExtension#getModulePrefix() - */ @Override protected String getModulePrefix() { return "aerospike"; } - /* - * (non-Javadoc) - * @see org.springframework.data.keyvalue.repository.config.KeyValueRepositoryConfigurationExtension#getDefaultKeyValueTemplateRef() - */ @Override protected String getDefaultKeyValueTemplateRef() { return "aerospikeTemplate"; } + @Override + public String getRepositoryFactoryBeanClassName() { + return AerospikeRepositoryFactoryBean.class.getName(); + } + + @Override + protected Collection> getIdentifyingAnnotations() { + return Collections.singleton(Document.class); + } + + @Override + protected Collection> getIdentifyingTypes() { + return Collections.singleton(AerospikeRepository.class); + } + @Override protected boolean useRepositoryConfiguration(RepositoryMetadata metadata) { return !metadata.isReactiveRepository(); diff --git a/src/main/java/org/springframework/data/aerospike/repository/config/ReactiveAerospikeRepositoriesRegistrar.java b/src/main/java/org/springframework/data/aerospike/repository/config/ReactiveAerospikeRepositoriesRegistrar.java index f308e3bfa..9db9424e7 100644 --- a/src/main/java/org/springframework/data/aerospike/repository/config/ReactiveAerospikeRepositoriesRegistrar.java +++ b/src/main/java/org/springframework/data/aerospike/repository/config/ReactiveAerospikeRepositoriesRegistrar.java @@ -12,19 +12,11 @@ */ public class ReactiveAerospikeRepositoriesRegistrar extends RepositoryBeanDefinitionRegistrarSupport { - /* - * (non-Javadoc) - * @see org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport#getAnnotation() - */ @Override protected Class getAnnotation() { return EnableReactiveAerospikeRepositories.class; } - /* - * (non-Javadoc) - * @see org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport#getExtension() - */ @Override protected RepositoryConfigurationExtension getExtension() { return new ReactiveAerospikeRepositoryConfigurationExtension(); diff --git a/src/main/java/org/springframework/data/aerospike/repository/config/ReactiveAerospikeRepositoryConfigurationExtension.java b/src/main/java/org/springframework/data/aerospike/repository/config/ReactiveAerospikeRepositoryConfigurationExtension.java index 63adcdcb7..bcd75a8e5 100644 --- a/src/main/java/org/springframework/data/aerospike/repository/config/ReactiveAerospikeRepositoryConfigurationExtension.java +++ b/src/main/java/org/springframework/data/aerospike/repository/config/ReactiveAerospikeRepositoryConfigurationExtension.java @@ -1,8 +1,15 @@ package org.springframework.data.aerospike.repository.config; +import org.springframework.data.aerospike.mapping.Document; +import org.springframework.data.aerospike.repository.ReactiveAerospikeRepository; +import org.springframework.data.aerospike.repository.support.ReactiveAerospikeRepositoryFactoryBean; import org.springframework.data.repository.config.RepositoryConfigurationExtension; import org.springframework.data.repository.core.RepositoryMetadata; +import java.lang.annotation.Annotation; +import java.util.Collection; +import java.util.Collections; + /** * {@link RepositoryConfigurationExtension} for reactive Aerospike. * @@ -25,6 +32,21 @@ protected String getDefaultKeyValueTemplateRef() { return "reactiveAerospikeTemplate"; } + @Override + public String getRepositoryFactoryBeanClassName() { + return ReactiveAerospikeRepositoryFactoryBean.class.getName(); + } + + @Override + protected Collection> getIdentifyingAnnotations() { + return Collections.singleton(Document.class); + } + + @Override + protected Collection> getIdentifyingTypes() { + return Collections.singleton(ReactiveAerospikeRepository.class); + } + @Override protected boolean useRepositoryConfiguration(RepositoryMetadata metadata) { return metadata.isReactiveRepository();