Polishing.

Reformat code.

See #3847
Original pull request: #3848.
This commit is contained in:
Mark Paluch
2021-10-05 10:08:14 +02:00
parent eed9b2470a
commit c7263e5b11

View File

@@ -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;
@@ -127,15 +129,15 @@ class DocumentPointerFactory {
/**
* Value object that computes a document pointer from a given lookup query by identifying SpEL expressions and
* inverting it.
*
*
* <pre class="code">
* // source
* { 'firstname' : ?#{fn}, 'lastname' : '?#{ln} }
*
*
* // target
* { 'fn' : ..., 'ln' : ... }
* </pre>
*
*
* The actual pointer is the computed via
* {@link #getDocumentPointer(MappingContext, MongoPersistentEntity, PersistentPropertyAccessor)} applying values from
* the provided {@link PersistentPropertyAccessor} to the target document by looking at the keys of the expressions