File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,10 @@ DocumentPointer<?> computePointer(
9191 if (idProperty .hasExplicitWriteTarget ()
9292 && conversionService .canConvert (idValue .getClass (), idProperty .getFieldType ())) {
9393 return () -> conversionService .convert (idValue , idProperty .getFieldType ());
94- } else if (idValue instanceof String && ObjectId .isValid ((String )idValue )) {
95- return () -> new ObjectId ((String )idValue );
94+ }
95+
96+ if (idValue instanceof String && ObjectId .isValid ((String ) idValue )) {
97+ return () -> new ObjectId ((String ) idValue );
9698 }
9799
98100 return () -> idValue ;
@@ -127,15 +129,15 @@ private boolean usesDefaultLookup(MongoPersistentProperty property) {
127129 /**
128130 * Value object that computes a document pointer from a given lookup query by identifying SpEL expressions and
129131 * inverting it.
130- *
132+ *
131133 * <pre class="code">
132134 * // source
133135 * { 'firstname' : ?#{fn}, 'lastname' : '?#{ln} }
134- *
136+ *
135137 * // target
136138 * { 'fn' : ..., 'ln' : ... }
137139 * </pre>
138- *
140+ *
139141 * The actual pointer is the computed via
140142 * {@link #getDocumentPointer(MappingContext, MongoPersistentEntity, PersistentPropertyAccessor)} applying values from
141143 * the provided {@link PersistentPropertyAccessor} to the target document by looking at the keys of the expressions
You can’t perform that action at this time.
0 commit comments