Restore feature 'Inject translation service bean in CouchbaseTemplateSupport'.

The feature was accidentally removed when DATACOUCH-550 was reverted.

Closes #1140.
This commit is contained in:
Jorge Rodríguez Martín
2021-01-15 19:29:14 +01:00
committed by mikereiche
parent 42b7fb3af8
commit 415d339556

View File

@@ -70,6 +70,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
* @author Simon Baslé
* @author Stephane Nicoll
* @author Subhashni Balakrishnan
* @author Jorge Rodriguez Martin
*/
@Configuration
public abstract class AbstractCouchbaseConfiguration {
@@ -158,15 +159,27 @@ public abstract class AbstractCouchbaseConfiguration {
}
@Bean(name = BeanNames.COUCHBASE_TEMPLATE)
public CouchbaseTemplate couchbaseTemplate(CouchbaseClientFactory couchbaseClientFactory,
MappingCouchbaseConverter mappingCouchbaseConverter, TranslationService couchbaseTranslationService) {
return new CouchbaseTemplate(couchbaseClientFactory, mappingCouchbaseConverter, couchbaseTranslationService);
}
public CouchbaseTemplate couchbaseTemplate(CouchbaseClientFactory couchbaseClientFactory,
MappingCouchbaseConverter mappingCouchbaseConverter) {
return new CouchbaseTemplate(couchbaseClientFactory, mappingCouchbaseConverter);
return couchbaseTemplate(couchbaseClientFactory, mappingCouchbaseConverter, new JacksonTranslationService());
}
@Bean(name = BeanNames.REACTIVE_COUCHBASE_TEMPLATE)
public ReactiveCouchbaseTemplate reactiveCouchbaseTemplate(CouchbaseClientFactory couchbaseClientFactory,
MappingCouchbaseConverter mappingCouchbaseConverter, TranslationService couchbaseTranslationService) {
return new ReactiveCouchbaseTemplate(couchbaseClientFactory, mappingCouchbaseConverter,
couchbaseTranslationService);
}
public ReactiveCouchbaseTemplate reactiveCouchbaseTemplate(CouchbaseClientFactory couchbaseClientFactory,
MappingCouchbaseConverter mappingCouchbaseConverter) {
return new ReactiveCouchbaseTemplate(couchbaseClientFactory, mappingCouchbaseConverter);
return reactiveCouchbaseTemplate(couchbaseClientFactory, mappingCouchbaseConverter,
new JacksonTranslationService());
}
@Bean(name = BeanNames.COUCHBASE_OPERATIONS_MAPPING)