|
|
|
|
@ -91,8 +91,10 @@ class DocumentPointerFactory {
@@ -91,8 +91,10 @@ class DocumentPointerFactory {
|
|
|
|
|
if (idProperty.hasExplicitWriteTarget() |
|
|
|
|
&& conversionService.canConvert(idValue.getClass(), idProperty.getFieldType())) { |
|
|
|
|
return () -> conversionService.convert(idValue, idProperty.getFieldType()); |
|
|
|
|
} else if (idValue instanceof String && ObjectId.isValid((String)idValue)) { |
|
|
|
|
return () -> new ObjectId((String)idValue); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (idValue instanceof String && ObjectId.isValid((String) idValue)) { |
|
|
|
|
return () -> new ObjectId((String) idValue); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return () -> idValue; |
|
|
|
|
|