-
Notifications
You must be signed in to change notification settings - Fork 192
Custom converter for multibuckets #1141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please provide a complete example. Or coordinates to the github project. |
From #878 "@mikereiche I tried to use special name for converter but issue still persist The problem is that the converters are not being registered with the conversion service. There is a workaround below.
|
works, thank you! |
It would probably be a good idea for all the templates to use the mappingCouchbaseConverter Bean (instead of creating their own). |
setCustomConverters() should call afterPropertiesSet() to register the converters. |
1) have AbstractCouchbaseConverter.setCustomConversions call afterPropertiesSet() to register converters with conversionService 2) have MappingCouchbaseConverter constructor with mappingContext set its applicationContext from the applicationContext from mappingContext 3) add getApplicationContext() to CouchbaseMappingContext to use in setting applicationContext of MappingCouchbaseConverter 4) change examples in Config to show creating repository mappings using existing MappingCouchbaseConverter (which have customConversions / BeanNames.COUCHBASE_CUSTOM_CONVERSIONS and applicationContext) instead of creating their own and then adding the customConversion and applicationContext. 5) remove unused members fro StringBasedN1qlQueryParser Closes #1141.
1) have AbstractCouchbaseConverter.setCustomConversions call afterPropertiesSet() to register converters with conversionService 2) have MappingCouchbaseConverter constructor with mappingContext set its applicationContext from the applicationContext from mappingContext 3) add getApplicationContext() to CouchbaseMappingContext to use in setting applicationContext of MappingCouchbaseConverter 4) change examples in Config to show creating repository mappings using existing MappingCouchbaseConverter (which have customConversions / BeanNames.COUCHBASE_CUSTOM_CONVERSIONS and applicationContext) instead of creating their own and then adding the customConversion and applicationContext. 5) remove unused members fro StringBasedN1qlQueryParser Closes #1141.
1) have AbstractCouchbaseConverter.setCustomConversions call afterPropertiesSet() to register converters with conversionService 2) have MappingCouchbaseConverter constructor with mappingContext set its applicationContext from the applicationContext from mappingContext 3) add getApplicationContext() to CouchbaseMappingContext to use in setting applicationContext of MappingCouchbaseConverter 4) change examples in Config to show creating repository mappings using existing MappingCouchbaseConverter (which have customConversions / BeanNames.COUCHBASE_CUSTOM_CONVERSIONS and applicationContext) instead of creating their own and then adding the customConversion and applicationContext. 5) replace @Autowired couchbaseObjectMapper with couchbaseObjectMapper() to avoid the following when using @componentscan : Unsatisfied dependency expressed through field 'couchbaseObjectMapper'; nested exception is org.springframework.beans.factory. BeanCurrentlyInCreationException: Error creating bean with name 'couchbaseObjectMapper': Requested bean is currently in creation: Is there an unresolvable circular reference? 6) remove unused members fro StringBasedN1qlQueryParser Closes #1141.
1) change examples in Config to show creating repository mappings using existing MappingCouchbaseConverter (which have customConversions / BeanNames.COUCHBASE_CUSTOM_CONVERSIONS and applicationContext) instead of creating their own and then adding the customConversion and applicationContext. 2) replace @Autowired couchbaseObjectMapper with couchbaseObjectMapper() to avoid the following when using @componentscan : Unsatisfied dependency expressed through field 'couchbaseObjectMapper'; nested exception is org.springframework.beans.factory. BeanCurrentlyInCreationException: Error creating bean with name 'couchbaseObjectMapper': Requested bean is currently in creation: Is there an unresolvable circular reference? 3) remove unused members fro StringBasedN1qlQueryParser Closes #1141.
1) change examples in Config to show creating repository mappings using existing MappingCouchbaseConverter (which have customConversions / BeanNames.COUCHBASE_CUSTOM_CONVERSIONS and applicationContext) instead of creating their own and then adding the customConversion and applicationContext. 2) replace @Autowired couchbaseObjectMapper with couchbaseObjectMapper() to avoid the following when using @componentscan : Unsatisfied dependency expressed through field 'couchbaseObjectMapper'; nested exception is org.springframework.beans.factory. BeanCurrentlyInCreationException: Error creating bean with name 'couchbaseObjectMapper': Requested bean is currently in creation: Is there an unresolvable circular reference? 3) remove unused members fro StringBasedN1qlQueryParser Closes #1141. Co-authored-by: mikereiche <[email protected]>
1) change examples in Config to show creating repository mappings using existing MappingCouchbaseConverter (which have customConversions / BeanNames.COUCHBASE_CUSTOM_CONVERSIONS and applicationContext) instead of creating their own and then adding the customConversion and applicationContext. 2) replace @Autowired couchbaseObjectMapper with couchbaseObjectMapper() to avoid the following when using @componentscan : Unsatisfied dependency expressed through field 'couchbaseObjectMapper'; nested exception is org.springframework.beans.factory. BeanCurrentlyInCreationException: Error creating bean with name 'couchbaseObjectMapper': Requested bean is currently in creation: Is there an unresolvable circular reference? 3) remove unused members fro StringBasedN1qlQueryParser Closes #1141. Co-authored-by: mikereiche <[email protected]>
@mikereiche I'm unsure of the state of this, has your improvement been merged ? if so in what version and what is the current best solution for this ? |
i implemented multibuckets according to explained in this issue but i can't add custom converters to all buckets, the converters added for default bucket only
please see my code:
Custome converter
add converter to the costum mapping:
I am getting below exception when save the doc although there is convertor from zonedatetime to couchebasedocument
Can you please help?
The text was updated successfully, but these errors were encountered: