Hi,
I am upgrading Aerospike client 4.1.3 → 5.1.11. Please help me to clear doubts on below 2 points.
1. CustomConversions constructor - In Older Version of CustomConversions constructor first parameter was List<?> converters so I have passed values Arrays.asList(StringToJava8LocalDateConverter.INSTANCE, Java8LocalDateToStringConverter.INSTANCE). But in New Version first parameter is StoreConversions so I am passing StoreConversions.of(AerospikeSimpleTypes.HOLDER,Collections.emptyList()). Please suggest if this is the correct way to use CustomConversions constructor.
2. setDefaultNameSpace - In older version I was setting setDefaultNameSpace as defaultNS in AerospikeMappingContext object but in new version defaultNameSpace is not present in AerospikeMappingContext. Please suggest if we can ignore setting defaultNameSpace in AerospikeMappingContext.
Below is the code for reference that I have implemented:
Older version code
CustomConversions conversions = new CustomConversions(Arrays.asList(StringToJava8LocalDateConverter.INSTANCE, Java8LocalDateToStringConverter.INSTANCE), AerospikeSimpleTypes.HOLDER);
AerospikeMappingContext mappingContext = new AerospikeMappingContext();
mappingContext.setDefaultNameSpace(defaultNS);
MappingAerospikeConverter converter = new MappingAerospikeConverter(mappingContext, conversions,new AerospikeTypeAliasAccessor(“type”));
New version Code
StoreConversions storeConversions = StoreConversions.of(AerospikeSimpleTypes.HOLDER,Collections.emptyList());
CustomConversions conversions = new CustomConversions(storeConversions, Arrays.asList(StringToJava8LocalDateConverter.INSTANCE, Java8LocalDateToStringConverter.INSTANCE));
MappingAerospikeConverter converter = new MappingAerospikeConverter(aerospikeMappingContext, conversions,new AerospikeTypeAliasAccessor(“type”));