public JsonDeserializer<?> findBeanDeserializer(JavaType type,
DeserializationConfig config, BeanDescription beanDesc)
throws JsonMappingException {
if (type.getRawClass() == DBRef.class) {
if (type.containedTypeCount() != 2) {
throw new JsonMappingException(
"Property doesn't declare object and key type");
}
JavaType objectType = type.containedType(0);
JavaType keyType = type.containedType(1);
return new DBRefDeserializer(objectType, keyType);