Hi guys,
Our model consist of pojo classes containing Map<String,Object> properties field.
I try to user PojoCodec to save them in Mongo, however:
1. In PojoCodecImpl, method addToCache determines the codec using type parameters: "getCodecFromTypeData(typeData.getTypeParameters().get(1)));" and saving the pojo results in "CodecConfigurationException: Can't find a codec for class java.lang.Object".
2. I tried converting the Map<String,Object> field to org.bson.Document field before saving the Pojo in Mongo. However, when PojoBuilderHeper.getTypeData() method is called with org.bson.Document parameter, it checks that it is a Map, but there are no type parameters - and it throws an Exception (TypeData:114: typeParameters.size() != 2).
If I forget about Pojo and save new Document(map) or Document.parse(jsonStringRepresentationOfMap) - java mongo driver can recognize the types correctly (dates, numbers, etc.) and save them in database. But if this map is a field in a Pojo - I cannot save it.