Skip to content

Propagate CouchbaseCustomConverters bean into MappingConverter constructor #1850

Closed
@mikereiche

Description

@mikereiche
AbstractCouchbaseConfiguration

@Bean
public MappingCouchbaseConverter mappingCouchbaseConverter(CouchbaseMappingContext couchbaseMappingContext,
		CustomConversions couchbaseCustomConversions) {
	MappingCouchbaseConverter converter = new MappingCouchbaseConverter(couchbaseMappingContext, typeKey(), couchbaseCustomConversions);
	converter.setCustomConversions(couchbaseCustomConversions);
	couchbaseMappingContext.setSimpleTypeHolder(couchbaseCustomConversions.getSimpleTypeHolder());
	return converter;
}
MappingCouchbaseConverter

public MappingCouchbaseConverter(
		final MappingContext<? extends CouchbasePersistentEntity<?>, CouchbasePersistentProperty> appingContext,
		final String typeKey,
		final CustomConversions couchbaseCustomConversions) {
	super(new DefaultConversionService(), couchbaseCustomConversions);
	this.mappingContext = mappingContext;
...
	//CustomConversions customConversions = new CouchbaseCustomConversions(Collections.emptyList()); // DO NOT CREATE
AbstractCouchbaseConverter

protected CustomConversions conversions = null; // DO NOT CREATE new CouchbaseCustomConversions(Collections.emptyList());

...
protected AbstractCouchbaseConverter(final GenericConversionService conversionService, CustomConversions customConversions) {
	this.conversionService = conversionService;
	this.conversions = customConversions != null ? customConversions : null ; // null is error??
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions