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(
91
91
if (idProperty .hasExplicitWriteTarget ()
92
92
&& conversionService .canConvert (idValue .getClass (), idProperty .getFieldType ())) {
93
93
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 );
96
98
}
97
99
98
100
return () -> idValue ;
@@ -127,15 +129,15 @@ private boolean usesDefaultLookup(MongoPersistentProperty property) {
127
129
/**
128
130
* Value object that computes a document pointer from a given lookup query by identifying SpEL expressions and
129
131
* inverting it.
130
- *
132
+ *
131
133
* <pre class="code">
132
134
* // source
133
135
* { 'firstname' : ?#{fn}, 'lastname' : '?#{ln} }
134
- *
136
+ *
135
137
* // target
136
138
* { 'fn' : ..., 'ln' : ... }
137
139
* </pre>
138
- *
140
+ *
139
141
* The actual pointer is the computed via
140
142
* {@link #getDocumentPointer(MappingContext, MongoPersistentEntity, PersistentPropertyAccessor)} applying values from
141
143
* 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