| Hi colleagues! I have some results of investigation. I describe my things. Any ideas welcome! Main problem in the method "decode" of class below
public class TupleCodec implements Codec<Tuple> {
@Override
public Tuple decode(BsonReader reader, DecoderContext decoderContext) {
...
}
....
}
Problem is I don't know what type is loaded. It leads to problem with mapping between field "_id" and field with annotation @Id . I see next ways:
- I can prepare not fully initialized Tuple by reading BsonReader. Initialization will finished in method "getTuple" (and the like)
- I can add new field "_type". But .... it leads to problem if json not contains the field
Any ideas or advises are welcome |