/** * Returns a new Repository based on the metadata. Two categories of repositories can be instantiated: * {@link SimpleCouchbaseRepository} and {@link N1qlCouchbaseRepository}. * * This method performs feature checks to decide which of the two categories can be instantiated (eg. is N1QL available?). * Instantiation is done via reflection, see {@link #getRepositoryBaseClass(RepositoryMetadata)}. * * @param metadata the repository metadata. * * @return a new created repository. */ @Override protected final Object getTargetRepository(final RepositoryInformation metadata) { CouchbaseOperations couchbaseOperations = couchbaseOperationsMapping.resolve(metadata.getRepositoryInterface(), metadata.getDomainType()); boolean isN1qlAvailable = couchbaseOperations.getCouchbaseClusterInfo().checkAvailable(CouchbaseFeature.N1QL); ViewIndexed viewIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), ViewIndexed.class); N1qlPrimaryIndexed n1qlPrimaryIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), N1qlPrimaryIndexed.class); N1qlSecondaryIndexed n1qlSecondaryIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), N1qlSecondaryIndexed.class); checkFeatures(metadata, isN1qlAvailable, n1qlPrimaryIndexed, n1qlSecondaryIndexed); indexManager.buildIndexes(metadata, viewIndexed, n1qlPrimaryIndexed, n1qlSecondaryIndexed, couchbaseOperations); CouchbaseEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType()); SimpleCouchbaseRepository repo = getTargetRepositoryViaReflection(metadata, entityInformation, couchbaseOperations); repo.setViewMetadataProvider(viewPostProcessor.getViewMetadataProvider()); return repo; }
/** * Returns a new Repository based on the metadata. Two categories of repositories can be instantiated: * {@link SimpleCouchbaseRepository} and {@link N1qlCouchbaseRepository}. * * This method performs feature checks to decide which of the two categories can be instantiated (eg. is N1QL available?). * Instantiation is done via reflection, see {@link #getRepositoryBaseClass(RepositoryMetadata)}. * * @param metadata the repository metadata. * * @return a new created repository. */ @Override protected final Object getTargetRepository(final RepositoryInformation metadata) { CouchbaseOperations couchbaseOperations = couchbaseOperationsMapping.resolve(metadata.getRepositoryInterface(), metadata.getDomainType()); boolean isN1qlAvailable = couchbaseOperations.getCouchbaseClusterInfo().checkAvailable(CouchbaseFeature.N1QL); ViewIndexed viewIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), ViewIndexed.class); N1qlPrimaryIndexed n1qlPrimaryIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), N1qlPrimaryIndexed.class); N1qlSecondaryIndexed n1qlSecondaryIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), N1qlSecondaryIndexed.class); checkFeatures(metadata, isN1qlAvailable, n1qlPrimaryIndexed, n1qlSecondaryIndexed); indexManager.buildIndexes(metadata, viewIndexed, n1qlPrimaryIndexed, n1qlSecondaryIndexed, couchbaseOperations); CouchbaseEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType()); SimpleCouchbaseRepository repo = getTargetRepositoryViaReflection(metadata, entityInformation, couchbaseOperations); repo.setViewMetadataProvider(viewPostProcessor.getViewMetadataProvider()); return repo; }
/** * Returns a new Repository based on the metadata. Two categories of repositories can be instantiated: * {@link SimpleReactiveCouchbaseRepository} and {@link ReactiveN1qlCouchbaseRepository}. * * This method performs feature checks to decide which of the two categories can be instantiated (eg. is N1QL available?). * Instantiation is done via reflection, see {@link #getRepositoryBaseClass(RepositoryMetadata)}. * * @param metadata the repository metadata. * * @return a new created repository. */ @Override protected final Object getTargetRepository(final RepositoryInformation metadata) { RxJavaCouchbaseOperations couchbaseOperations = couchbaseOperationsMapping.resolve(metadata.getRepositoryInterface(), metadata.getDomainType()); boolean isN1qlAvailable = couchbaseOperations.getCouchbaseClusterInfo().checkAvailable(CouchbaseFeature.N1QL); ViewIndexed viewIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), ViewIndexed.class); N1qlPrimaryIndexed n1qlPrimaryIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), N1qlPrimaryIndexed.class); N1qlSecondaryIndexed n1qlSecondaryIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), N1qlSecondaryIndexed.class); checkFeatures(metadata, isN1qlAvailable, n1qlPrimaryIndexed, n1qlSecondaryIndexed); indexManager.buildIndexes(metadata, viewIndexed, n1qlPrimaryIndexed, n1qlSecondaryIndexed, couchbaseOperations); CouchbaseEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType()); SimpleReactiveCouchbaseRepository repo = getTargetRepositoryViaReflection(metadata, entityInformation, couchbaseOperations); repo.setViewMetadataProvider(viewPostProcessor.getViewMetadataProvider()); return repo; }
/** * Returns a new Repository based on the metadata. Two categories of repositories can be instantiated: * {@link SimpleReactiveCouchbaseRepository} and {@link ReactiveN1qlCouchbaseRepository}. * * This method performs feature checks to decide which of the two categories can be instantiated (eg. is N1QL available?). * Instantiation is done via reflection, see {@link #getRepositoryBaseClass(RepositoryMetadata)}. * * @param metadata the repository metadata. * * @return a new created repository. */ @Override protected final Object getTargetRepository(final RepositoryInformation metadata) { RxJavaCouchbaseOperations couchbaseOperations = couchbaseOperationsMapping.resolve(metadata.getRepositoryInterface(), metadata.getDomainType()); boolean isN1qlAvailable = couchbaseOperations.getCouchbaseClusterInfo().checkAvailable(CouchbaseFeature.N1QL); ViewIndexed viewIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), ViewIndexed.class); N1qlPrimaryIndexed n1qlPrimaryIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), N1qlPrimaryIndexed.class); N1qlSecondaryIndexed n1qlSecondaryIndexed = AnnotationUtils.findAnnotation(metadata.getRepositoryInterface(), N1qlSecondaryIndexed.class); checkFeatures(metadata, isN1qlAvailable, n1qlPrimaryIndexed, n1qlSecondaryIndexed); indexManager.buildIndexes(metadata, viewIndexed, n1qlPrimaryIndexed, n1qlSecondaryIndexed, couchbaseOperations); CouchbaseEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType()); SimpleReactiveCouchbaseRepository repo = getTargetRepositoryViaReflection(metadata, entityInformation, couchbaseOperations); repo.setViewMetadataProvider(viewPostProcessor.getViewMetadataProvider()); return repo; }