Expose template getScope(), getCollection() and potentiallyConvertRuntimeException. (#1317)

Closes #1310.
This commit is contained in:
Michael Reiche
2022-02-01 13:43:14 -08:00
committed by mikereiche
parent 76cf013778
commit 416ce9e843
2 changed files with 5 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2021 the original author or authors * Copyright 2012-2022 the original author or authors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -165,7 +165,7 @@ public class ReactiveCouchbaseTemplate implements ReactiveCouchbaseOperations, A
* *
* @param ex the exception to translate * @param ex the exception to translate
*/ */
RuntimeException potentiallyConvertRuntimeException(final RuntimeException ex) { protected RuntimeException potentiallyConvertRuntimeException(final RuntimeException ex) {
RuntimeException resolved = exceptionTranslator.translateExceptionIfPossible(ex); RuntimeException resolved = exceptionTranslator.translateExceptionIfPossible(ex);
return resolved == null ? ex : resolved; return resolved == null ? ex : resolved;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2021 the original author or authors. * Copyright 2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ public class CouchbaseRepositoryBase<T, ID> {
* 1. repository.withCollection() 2. Annotation on the method * 1. repository.withCollection() 2. Annotation on the method
*/ */
String getScope() { protected String getScope() {
String fromAnnotation = OptionsBuilder.annotationString(Scope.class, CollectionIdentifier.DEFAULT_SCOPE, String fromAnnotation = OptionsBuilder.annotationString(Scope.class, CollectionIdentifier.DEFAULT_SCOPE,
new AnnotatedElement[] { getJavaType(), repositoryInterface }); new AnnotatedElement[] { getJavaType(), repositoryInterface });
String fromMetadata = crudMethodMetadata.getScope(); String fromMetadata = crudMethodMetadata.getScope();
@@ -83,7 +83,7 @@ public class CouchbaseRepositoryBase<T, ID> {
* This can be overriden in the operation method by<br> * This can be overriden in the operation method by<br>
* 1. repository.withCollection() * 1. repository.withCollection()
*/ */
String getCollection() { protected String getCollection() {
String fromAnnotation = OptionsBuilder.annotationString(Collection.class, CollectionIdentifier.DEFAULT_COLLECTION, String fromAnnotation = OptionsBuilder.annotationString(Collection.class, CollectionIdentifier.DEFAULT_COLLECTION,
new AnnotatedElement[] { getJavaType(), repositoryInterface }); new AnnotatedElement[] { getJavaType(), repositoryInterface });
String fromMetadata = crudMethodMetadata.getCollection(); String fromMetadata = crudMethodMetadata.getCollection();