diff --git a/src/main/java/org/springframework/data/couchbase/config/AbstractCouchbaseConfiguration.java b/src/main/java/org/springframework/data/couchbase/config/AbstractCouchbaseConfiguration.java index c97f3d8a3..4db4a2936 100644 --- a/src/main/java/org/springframework/data/couchbase/config/AbstractCouchbaseConfiguration.java +++ b/src/main/java/org/springframework/data/couchbase/config/AbstractCouchbaseConfiguration.java @@ -428,6 +428,7 @@ public CustomConversions customConversions() { * and {@link #couchbaseMappingContext(CustomConversions)}. * * @param cryptoManager + * @param objectMapper * @return must not be {@literal null}. */ public CustomConversions customConversions(CryptoManager cryptoManager, ObjectMapper objectMapper) { @@ -437,6 +438,7 @@ public CustomConversions customConversions(CryptoManager cryptoManager, ObjectMa newConverters.add(new IntegerToEnumConverterFactory(getObjectMapper())); newConverters.add(new StringToEnumConverterFactory(getObjectMapper())); newConverters.add(new BooleanToEnumConverterFactory(getObjectMapper())); + additionalConverters(newConverters); CustomConversions customConversions = CouchbaseCustomConversions.create(configurationAdapter -> { SimplePropertyValueConversions valueConversions = new SimplePropertyValueConversions(); valueConversions.setConverterFactory( @@ -449,6 +451,13 @@ public CustomConversions customConversions(CryptoManager cryptoManager, ObjectMa return customConversions; } + /** + * This should be overridden in order to update the {@link #customConversions(CryptoManager cryptoManager, ObjectMapper objectMapper)} List + */ + protected void additionalConverters(List converters) { + // NO_OP + } + public static Map, Class> annotationToConverterMap() { Map, Class> map = new HashMap(); map.put(Encrypted.class, CryptoConverter.class);